test_class.declarator: BUCKET_NAME = "bucket-name"
test_class.modifier: private static final
test_class.original_string: private static final String BUCKET_NAME = "bucket-name";
test_class.type: String
test_class.var_name: BUCKET_NAME
test_class.declarator: OBJECT_NAME = "object-name"
test_class.modifier: private static final
test_class.original_string: private static final String OBJECT_NAME = "object-name";
test_class.type: String
test_class.var_name: OBJECT_NAME
test_class.declarator: UPLOAD_ID = "upload-id"
test_class.modifier: private static final
test_class.original_string: private static final String UPLOAD_ID = "upload-id";
test_class.type: String
test_class.var_name: UPLOAD_ID
test_class.declarator: CONTENT_TYPE = "image/jpeg"
test_class.modifier: private static final
test_class.original_string: private static final String CONTENT_TYPE = "image/jpeg";
test_class.type: String
test_class.var_name: CONTENT_TYPE
test_class.declarator: START_REQUEST =
        StartResumableWriteRequest.newBuilder()
            .setInsertObjectSpec(
                InsertObjectSpec.newBuilder()
                    .setResource(
                        Object.newBuilder()
                            .setBucket(BUCKET_NAME)
                            .setName(OBJECT_NAME)
                            .setContentType(CONTENT_TYPE)))
            .build()
test_class.modifier: private static final
test_class.original_string: private static final StartResumableWriteRequest START_REQUEST =
        StartResumableWriteRequest.newBuilder()
            .setInsertObjectSpec(
                InsertObjectSpec.newBuilder()
                    .setResource(
                        Object.newBuilder()
                            .setBucket(BUCKET_NAME)
                            .setName(OBJECT_NAME)
                            .setContentType(CONTENT_TYPE)))
            .build();
test_class.type: StartResumableWriteRequest
test_class.var_name: START_REQUEST
test_class.declarator: WRITE_STATUS_REQUEST =
        QueryWriteStatusRequest.newBuilder().setUploadId(UPLOAD_ID).build()
test_class.modifier: private static final
test_class.original_string: private static final QueryWriteStatusRequest WRITE_STATUS_REQUEST =
        QueryWriteStatusRequest.newBuilder().setUploadId(UPLOAD_ID).build();
test_class.type: QueryWriteStatusRequest
test_class.var_name: WRITE_STATUS_REQUEST
test_class.declarator: stub
test_class.modifier: private
test_class.original_string: private StorageStub stub;
test_class.type: StorageStub
test_class.var_name: stub
test_class.declarator: fakeService
test_class.modifier: private
test_class.original_string: private FakeService fakeService;
test_class.type: FakeService
test_class.var_name: fakeService
test_class.declarator: executor = Executors.newCachedThreadPool()
test_class.modifier: private
test_class.original_string: private ExecutorService executor = Executors.newCachedThreadPool();
test_class.type: ExecutorService
test_class.var_name: executor
test_class.file: gcsio/src/test/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageGrpcWriteChannelTest.java
test_class.identifier: GoogleCloudStorageGrpcWriteChannelTest
test_case.body: @Test
    public void getItemInfoReturnsCorrectItemInfo() throws Exception {
      fakeService.setObject(
          FakeService.DEFAULT_OBJECT.toBuilder()
              .setSize(9)
              .setGeneration(1)
              .setMetageneration(2)
              .setTimeCreated(Timestamp.newBuilder().setSeconds(1560485630).setNanos(7000000))
              .setUpdated(Timestamp.newBuilder().setSeconds(1560495630).setNanos(123000000))
              .setContentEncoding("content-encoding")
              .putMetadata("metadata-key-1", "dGVzdC1tZXRhZGF0YQ==")
              .setMd5Hash("k0K1eqORVuY208nAADpz6w==")
              .setCrc32C(UInt32Value.newBuilder().setValue(uInt32Value(863614154)))
              .build());
      GoogleCloudStorageGrpcWriteChannel writeChannel = newWriteChannel();
  
      ByteString data = ByteString.copyFromUtf8("test data");
      writeChannel.initialize();
      writeChannel.write(data.asReadOnlyByteBuffer());
      writeChannel.close();
      GoogleCloudStorageItemInfo itemInfo = writeChannel.getItemInfo();
  
      byte[] expectedMd5Hash = {
        -109, 66, -75, 122, -93, -111, 86, -26, 54, -45, -55, -64, 0, 58, 115, -21
      };
      byte[] expectedCrc32C = {51, 121, -76, -54};
      Map<String, byte[]> expectedMetadata =
          ImmutableMap.of(
              "metadata-key-1",
              new byte[] {116, 101, 115, 116, 45, 109, 101, 116, 97, 100, 97, 116, 97});
      GoogleCloudStorageItemInfo expectedItemInfo =
          new GoogleCloudStorageItemInfo(
              new StorageResourceId(BUCKET_NAME, OBJECT_NAME),
              1560485630007L,
              1560495630123L,
              /* size= */ 9,
              /* location= */ null,
              /* storageClass= */ null,
              CONTENT_TYPE,
              "content-encoding",
              expectedMetadata,
              1,
              2,
              new VerificationAttributes(expectedMd5Hash, expectedCrc32C));
  
      assertThat(itemInfo).isEqualTo(expectedItemInfo);
    }
test_case.class_method_signature: GoogleCloudStorageGrpcWriteChannelTest.getItemInfoReturnsCorrectItemInfo()
test_case.full_signature: @Test public void getItemInfoReturnsCorrectItemInfo()
test_case.identifier: getItemInfoReturnsCorrectItemInfo
test_case.invocations: setObject build setCrc32C setMd5Hash putMetadata setContentEncoding setUpdated setTimeCreated setMetageneration setGeneration setSize toBuilder setNanos setSeconds newBuilder setNanos setSeconds newBuilder setValue newBuilder uInt32Value newWriteChannel copyFromUtf8 initialize write asReadOnlyByteBuffer close getItemInfo of isEqualTo assertThat
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void getItemInfoReturnsCorrectItemInfo()
focal_class.declarator: GCS_MINIMUM_CHUNK_SIZE = 256 * 1024
focal_class.modifier: static final
focal_class.original_string: static final int GCS_MINIMUM_CHUNK_SIZE = 256 * 1024;
focal_class.type: int
focal_class.var_name: GCS_MINIMUM_CHUNK_SIZE
focal_class.declarator: START_RESUMABLE_WRITE_TIMEOUT = Duration.ofMinutes(1)
focal_class.modifier: private static final
focal_class.original_string: private static final Duration START_RESUMABLE_WRITE_TIMEOUT = Duration.ofMinutes(1);
focal_class.type: Duration
focal_class.var_name: START_RESUMABLE_WRITE_TIMEOUT
focal_class.declarator: QUERY_WRITE_STATUS_TIMEOUT = Duration.ofMinutes(1)
focal_class.modifier: private static final
focal_class.original_string: private static final Duration QUERY_WRITE_STATUS_TIMEOUT = Duration.ofMinutes(1);
focal_class.type: Duration
focal_class.var_name: QUERY_WRITE_STATUS_TIMEOUT
focal_class.declarator: WRITE_STREAM_TIMEOUT = Duration.ofMinutes(10)
focal_class.modifier: private static final
focal_class.original_string: private static final Duration WRITE_STREAM_TIMEOUT = Duration.ofMinutes(10);
focal_class.type: Duration
focal_class.var_name: WRITE_STREAM_TIMEOUT
focal_class.declarator: UPLOAD_RETRIES = 5
focal_class.modifier: private static final
focal_class.original_string: private static final int UPLOAD_RETRIES = 5;
focal_class.type: int
focal_class.var_name: UPLOAD_RETRIES
focal_class.declarator: NUMBER_OF_REQUESTS_TO_RETAIN = 5
focal_class.modifier: private static final
focal_class.original_string: private static final int NUMBER_OF_REQUESTS_TO_RETAIN = 5;
focal_class.type: int
focal_class.var_name: NUMBER_OF_REQUESTS_TO_RETAIN
focal_class.declarator: TRANSIENT_ERRORS =
        ImmutableSet.of(
            Code.DEADLINE_EXCEEDED, Code.RESOURCE_EXHAUSTED, Code.INTERNAL, Code.UNAVAILABLE)
focal_class.modifier: private static final
focal_class.original_string: private static final ImmutableSet<Code> TRANSIENT_ERRORS =
        ImmutableSet.of(
            Code.DEADLINE_EXCEEDED, Code.RESOURCE_EXHAUSTED, Code.INTERNAL, Code.UNAVAILABLE);
focal_class.type: ImmutableSet<Code>
focal_class.var_name: TRANSIENT_ERRORS
focal_class.declarator: stub
focal_class.modifier: private final
focal_class.original_string: private final StorageStub stub;
focal_class.type: StorageStub
focal_class.var_name: stub
focal_class.declarator: resourceId
focal_class.modifier: private final
focal_class.original_string: private final StorageResourceId resourceId;
focal_class.type: StorageResourceId
focal_class.var_name: resourceId
focal_class.declarator: createOptions
focal_class.modifier: private final
focal_class.original_string: private final CreateObjectOptions createOptions;
focal_class.type: CreateObjectOptions
focal_class.var_name: createOptions
focal_class.declarator: writeConditions
focal_class.modifier: private final
focal_class.original_string: private final ObjectWriteConditions writeConditions;
focal_class.type: ObjectWriteConditions
focal_class.var_name: writeConditions
focal_class.declarator: requesterPaysProject
focal_class.modifier: private final
focal_class.original_string: private final String requesterPaysProject;
focal_class.type: String
focal_class.var_name: requesterPaysProject
focal_class.declarator: completedItemInfo = null
focal_class.modifier: private
focal_class.original_string: private GoogleCloudStorageItemInfo completedItemInfo = null;
focal_class.type: GoogleCloudStorageItemInfo
focal_class.var_name: completedItemInfo
focal_class.file: gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageGrpcWriteChannel.java
focal_class.identifier: GoogleCloudStorageGrpcWriteChannel
focal_class.interfaces: implements GoogleCloudStorageItemInfo.Provider
focal_class.class_method_signature: GoogleCloudStorageGrpcWriteChannel.GoogleCloudStorageGrpcWriteChannel(
        StorageStub stub,
        ExecutorService threadPool,
        AsyncWriteChannelOptions channelOptions,
        StorageResourceId resourceId,
        CreateObjectOptions createOptions,
        ObjectWriteConditions writeConditions,
        String requesterPaysProject)
focal_class.full_signature:   GoogleCloudStorageGrpcWriteChannel(
        StorageStub stub,
        ExecutorService threadPool,
        AsyncWriteChannelOptions channelOptions,
        StorageResourceId resourceId,
        CreateObjectOptions createOptions,
        ObjectWriteConditions writeConditions,
        String requesterPaysProject)
focal_class.identifier: GoogleCloudStorageGrpcWriteChannel
focal_class.parameters: (
        StorageStub stub,
        ExecutorService threadPool,
        AsyncWriteChannelOptions channelOptions,
        StorageResourceId resourceId,
        CreateObjectOptions createOptions,
        ObjectWriteConditions writeConditions,
        String requesterPaysProject)
focal_class.signature:  GoogleCloudStorageGrpcWriteChannel(
        StorageStub stub,
        ExecutorService threadPool,
        AsyncWriteChannelOptions channelOptions,
        StorageResourceId resourceId,
        CreateObjectOptions createOptions,
        ObjectWriteConditions writeConditions,
        String requesterPaysProject)
focal_class.class_method_signature: GoogleCloudStorageGrpcWriteChannel.getResourceString()
focal_class.full_signature: @Override protected String getResourceString()
focal_class.identifier: getResourceString
focal_class.modifiers: @Override protected
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getResourceString()
focal_class.class_method_signature: GoogleCloudStorageGrpcWriteChannel.handleResponse(Object response)
focal_class.full_signature: @Override public void handleResponse(Object response)
focal_class.identifier: handleResponse
focal_class.modifiers: @Override public
focal_class.parameters: (Object response)
focal_class.return: void
focal_class.signature: void handleResponse(Object response)
focal_class.class_method_signature: GoogleCloudStorageGrpcWriteChannel.startUpload(InputStream pipeSource)
focal_class.full_signature: @Override public void startUpload(InputStream pipeSource)
focal_class.identifier: startUpload
focal_class.modifiers: @Override public
focal_class.parameters: (InputStream pipeSource)
focal_class.return: void
focal_class.signature: void startUpload(InputStream pipeSource)
focal_class.class_method_signature: GoogleCloudStorageGrpcWriteChannel.getItemInfo()
focal_class.full_signature: @Override public GoogleCloudStorageItemInfo getItemInfo()
focal_class.identifier: getItemInfo
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: GoogleCloudStorageItemInfo
focal_class.signature: GoogleCloudStorageItemInfo getItemInfo()
focal_class.superclass: extends BaseAbstractGoogleAsyncWriteChannel<Object>
focal_method.body: @Override
    public GoogleCloudStorageItemInfo getItemInfo() {
      return this.completedItemInfo;
    }
focal_method.class_method_signature: GoogleCloudStorageGrpcWriteChannel.getItemInfo()
focal_method.full_signature: @Override public GoogleCloudStorageItemInfo getItemInfo()
focal_method.identifier: getItemInfo
focal_method.modifiers: @Override public
focal_method.parameters: ()
focal_method.return: GoogleCloudStorageItemInfo
focal_method.signature: GoogleCloudStorageItemInfo getItemInfo()