Returns the part count of the object represented by the getObjectRequest.

@param getObjectRequest
The request to check.
@param s3
The Amazon s3 client.

@return  The number of parts in the object if it is multipart object, otherwise returns null.
196704
public static Integer getPartCount(GetObjectRequest getObjectRequest, AmazonS3 s3) {
        ValidationUtils.assertNotNull(s3, "S3 client");
        ValidationUtils.assertNotNull(getObjectRequest, "GetObjectRequest");

        GetObjectMetadataRequest getObjectMetadataRequest = RequestCopyUtils.createGetObjectMetadataRequestFrom(getObjectRequest)
                .withPartNumber(1);

        return s3.getObjectMetadata(getObjectMetadataRequest).getPartCount();
    }
1330872
@Override
    public InputStream getPart(String partName) throws IOException {
        try {
            Part part = request.getPart(partName);
            return (part == null) ? null : part.getInputStream();
        } catch (ServletException e) {
            throw new IOException(e);
        }
    }
1177089
public static boolean isDownloadParallelizable(final AmazonS3 s3, final GetObjectRequest getObjectRequest,
            Integer partCount) {
        ValidationUtils.assertNotNull(s3, "S3 client");
        ValidationUtils.assertNotNull(getObjectRequest, "GetObjectRequest");

        if (s3 instanceof AmazonS3Encryption || getObjectRequest.getRange() != null
                || getObjectRequest.getPartNumber() != null || partCount == null) {
            return false;
        }
        return true;
    }
997162
def xml_marshal_delete_objects(object_names):
    
    root = s3_xml.Element('Delete')

    # use quiet mode in the request - this causes the S3 Server to
    # limit its response to only object keys that had errors during
    # the delete operation.
    quiet = s3_xml.SubElement(root, 'Quiet')
    quiet.text = "true"

    # add each object to the request.
    for object_name in object_names:
        object_elt = s3_xml.SubElement(root, 'Object')
        key_elt = s3_xml.SubElement(object_elt, 'Key')
        key_elt.text = object_name

    # return the marshalled xml.
    data = io.BytesIO()
    s3_xml.ElementTree(root).write(data, encoding=None, xml_declaration=False)
    return data.getvalue()
1364922
public int getCount(T obj) {
        int objIndex = (allowNewIndices) 
            ? objectIndices.index(obj)
            : objectIndices.find(obj);
        return (objIndex < 0) ? 0 : indexToCount.get(objIndex);
    }
79317
public long getNumberOfCompletedRequests()
  {    
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) 
      SibTr.entry(tc, "getNumberOfCompletedRequests" );

    long returnValue = anycastIH.getCompletedRequestCount();
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) 
      SibTr.exit(tc, "getNumberOfCompletedRequests", Long.valueOf(returnValue));
    return returnValue;
  }
76599
public UploadPartResult uploadPart(UploadPartRequest request)
      throws AmazonClientException {
    try {
      UploadPartResult uploadPartResult = mClient.uploadPart(request);
      return uploadPartResult;
    } catch (AmazonClientException e) {
      throw e;
    }
  }
620767
private UploadResult uploadPartsInSeries(UploadPartRequestFactory requestFactory) {

        final List<PartETag> partETags = new ArrayList<PartETag>();

        while (requestFactory.hasMoreRequests()) {
            if (threadPool.isShutdown()) throw new CancellationException("TransferManager has been shutdown");
            UploadPartRequest uploadPartRequest = requestFactory.getNextUploadPartRequest();
            // Mark the stream in case we need to reset it
            InputStream inputStream = uploadPartRequest.getInputStream();
            if (inputStream != null && inputStream.markSupported()) {
                if (uploadPartRequest.getPartSize() >= Integer.MAX_VALUE) {
                    inputStream.mark(Integer.MAX_VALUE);
                } else {
                    inputStream.mark((int)uploadPartRequest.getPartSize());
                }
            }
            partETags.add(s3.uploadPart(uploadPartRequest).getPartETag());
        }

        CompleteMultipartUploadRequest req =
            new CompleteMultipartUploadRequest(
                origReq.getBucketName(), origReq.getKey(), multipartUploadId,
                    partETags)
                    .withRequesterPays(origReq.isRequesterPays())
            .withGeneralProgressListener(origReq.getGeneralProgressListener())
            .withRequestMetricCollector(origReq.getRequestMetricCollector())
            ;
        CompleteMultipartUploadResult res = s3.completeMultipartUpload(req);

        UploadResult uploadResult = new UploadResult();
        uploadResult.setBucketName(res.getBucketName());
        uploadResult.setKey(res.getKey());
        uploadResult.setETag(res.getETag());
        uploadResult.setVersionId(res.getVersionId());
        return uploadResult;
    }
307857
public static Object getObjectFromBytes(byte[] objBytes) throws Exception {
		if (objBytes == null || objBytes.length == 0) {
			return null;
		}
		ByteArrayInputStream bi = new ByteArrayInputStream(objBytes);
		ObjectInputStream oi = new ObjectInputStream(bi);
		return oi.readObject();
	}
1266326
@Override
    public Part getPart(String name) throws IOException, ServletException {
        return this._getHttpServletRequest().getPart(name); 
    
    }
563674
public static long getLastByteInPart(AmazonS3 s3, GetObjectRequest getObjectRequest, Integer partNumber) {
        ValidationUtils.assertNotNull(s3, "S3 client");
        ValidationUtils.assertNotNull(getObjectRequest, "GetObjectRequest");
        ValidationUtils.assertNotNull(partNumber, "partNumber");

        ObjectMetadata metadata = s3.getObjectMetadata(new GetObjectMetadataRequest(getObjectRequest.getBucketName(), getObjectRequest.getKey(), getObjectRequest.getVersionId())
                .withSSECustomerKey(getObjectRequest.getSSECustomerKey())
                .withPartNumber(partNumber));
        return metadata.getContentRange()[1];
    }
877456
public static GetObjectMetadataRequest createGetObjectMetadataRequestFrom(GetObjectRequest getObjectRequest) {
        return new GetObjectMetadataRequest(getObjectRequest.getBucketName(), getObjectRequest.getKey())
                .withVersionId(getObjectRequest.getVersionId())
                .withRequesterPays(getObjectRequest.isRequesterPays())
                .withSSECustomerKey(getObjectRequest.getSSECustomerKey())
                .withPartNumber(getObjectRequest.getPartNumber());
    }
893979
public Part getPart(String partLabel)
  {
    if (m_parts!=null)
    {
        for (Object m_part : m_parts) {
            Part p = (Part) m_part;
            //if (p.getLabel().equals(partLabel)
            //	|| p.getLabel().equals(""+partLabel.charAt(0))) {
            if (p.getLabel().charAt(0) == partLabel.charAt(0)) {
                if (partLabel.length() > 1) {
                    p.setLabel(partLabel);
                }
                return p;
            }
        }
    	return null;
    }
    else
      return null;
  }
185653
private void addPartNumberIfNotNull(Request<?> request, Integer partNumber) {
        if (partNumber != null) {
            request.addParameter("partNumber", partNumber.toString());
        }
    }
1201977
public ByteArrayOutputStream getPartialObjectData(String bucket, String fname, long start, long endIncl) throws IOException {
    return getPartialObjectData(bucket, fname, start, endIncl, null);
  }
1272134
public int getCount(Object o) {
    int[] nums = (int[]) cset.get(o);   
    if (nums == null ) {
      return(0);
    }
    else {
      return(nums[0]);
    }
  }
105191
@Override
	public int getPartition(DatumWrapper<ITuple> key, NullWritable value, int numPartitions) {
		if(numPartitions == 1) {
			// in this case the schema is not checked if it's valid
			return 0;
		} else {
			ITuple tuple = key.datum();
			String sourceName = tuple.getSchema().getName();
			Integer schemaId = tupleMRConfig.getSchemaIdByName(sourceName);
			if(schemaId == null) {
				throw new RuntimeException("Schema name '" + sourceName
				    + "' is unknown. Known schemas are : "
				    + tupleMRConfig.getIntermediateSchemaNames());
			}
			int[] fieldsToPartition = serInfo.getPartitionFieldsIndexes().get(schemaId);
			if(fieldsToPartition.length == 0) {
				throw new RuntimeException("Fields to partition is 0. Something has been wrongly configured.");
			}
			return (partialHashCode(tuple, fieldsToPartition) & Integer.MAX_VALUE)
			    % numPartitions;
		}
	}