test_class.file: gcsio/src/test/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageWriteChannelTest.java
test_class.identifier: GoogleCloudStorageWriteChannelTest
test_case.body: @Test
    public void createRequest_shouldSetKmsKeyName() throws IOException {
      String kmsKeyName = "testKmsKey";
  
      GoogleCloudStorageWriteChannel writeChannel =
          new GoogleCloudStorageWriteChannel(
              new Storage(HTTP_TRANSPORT, JSON_FACTORY, r -> {}),
              new ClientRequestHelper<>(),
              newDirectExecutorService(),
              AsyncWriteChannelOptions.DEFAULT,
              new StorageResourceId(BUCKET_NAME, OBJECT_NAME),
              CreateObjectOptions.DEFAULT_NO_OVERWRITE.toBuilder().setKmsKeyName(kmsKeyName).build(),
              ObjectWriteConditions.NONE);
  
      Storage.Objects.Insert request =
          writeChannel.createRequest(
              new InputStreamContent("plain/text", new ByteArrayInputStream(new byte[0])));
  
      assertThat(request.getKmsKeyName()).isEqualTo(kmsKeyName);
    }
test_case.class_method_signature: GoogleCloudStorageWriteChannelTest.createRequest_shouldSetKmsKeyName()
test_case.full_signature: @Test public void createRequest_shouldSetKmsKeyName()
test_case.identifier: createRequest_shouldSetKmsKeyName
test_case.invocations: newDirectExecutorService build setKmsKeyName toBuilder createRequest isEqualTo assertThat getKmsKeyName
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void createRequest_shouldSetKmsKeyName()
focal_class.declarator: MIN_LOGGING_INTERVAL_MS = 60000L
focal_class.modifier: private static final
focal_class.original_string: private static final long MIN_LOGGING_INTERVAL_MS = 60000L;
focal_class.type: long
focal_class.var_name: MIN_LOGGING_INTERVAL_MS
focal_class.declarator: gcs
focal_class.modifier: private final
focal_class.original_string: private final Storage gcs;
focal_class.type: Storage
focal_class.var_name: gcs
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: 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/GoogleCloudStorageWriteChannel.java
focal_class.identifier: GoogleCloudStorageWriteChannel
focal_class.interfaces: implements GoogleCloudStorageItemInfo.Provider
focal_class.class_method_signature: GoogleCloudStorageWriteChannel.GoogleCloudStorageWriteChannel(
        Storage gcs,
        ClientRequestHelper<StorageObject> requestHelper,
        ExecutorService uploadThreadPool,
        AsyncWriteChannelOptions channelOptions,
        StorageResourceId resourceId,
        CreateObjectOptions createOptions,
        ObjectWriteConditions writeConditions)
focal_class.full_signature: public  GoogleCloudStorageWriteChannel(
        Storage gcs,
        ClientRequestHelper<StorageObject> requestHelper,
        ExecutorService uploadThreadPool,
        AsyncWriteChannelOptions channelOptions,
        StorageResourceId resourceId,
        CreateObjectOptions createOptions,
        ObjectWriteConditions writeConditions)
focal_class.identifier: GoogleCloudStorageWriteChannel
focal_class.modifiers: public
focal_class.parameters: (
        Storage gcs,
        ClientRequestHelper<StorageObject> requestHelper,
        ExecutorService uploadThreadPool,
        AsyncWriteChannelOptions channelOptions,
        StorageResourceId resourceId,
        CreateObjectOptions createOptions,
        ObjectWriteConditions writeConditions)
focal_class.signature:  GoogleCloudStorageWriteChannel(
        Storage gcs,
        ClientRequestHelper<StorageObject> requestHelper,
        ExecutorService uploadThreadPool,
        AsyncWriteChannelOptions channelOptions,
        StorageResourceId resourceId,
        CreateObjectOptions createOptions,
        ObjectWriteConditions writeConditions)
focal_class.class_method_signature: GoogleCloudStorageWriteChannel.createRequest(InputStreamContent inputStream)
focal_class.full_signature: @Override public Insert createRequest(InputStreamContent inputStream)
focal_class.identifier: createRequest
focal_class.modifiers: @Override public
focal_class.parameters: (InputStreamContent inputStream)
focal_class.return: Insert
focal_class.signature: Insert createRequest(InputStreamContent inputStream)
focal_class.class_method_signature: GoogleCloudStorageWriteChannel.handleResponse(StorageObject response)
focal_class.full_signature: @Override public void handleResponse(StorageObject response)
focal_class.identifier: handleResponse
focal_class.modifiers: @Override public
focal_class.parameters: (StorageObject response)
focal_class.return: void
focal_class.signature: void handleResponse(StorageObject response)
focal_class.class_method_signature: GoogleCloudStorageWriteChannel.createResponseFromException(IOException e)
focal_class.full_signature: @Override public StorageObject createResponseFromException(IOException e)
focal_class.identifier: createResponseFromException
focal_class.modifiers: @Override public
focal_class.parameters: (IOException e)
focal_class.return: StorageObject
focal_class.signature: StorageObject createResponseFromException(IOException e)
focal_class.class_method_signature: GoogleCloudStorageWriteChannel.getContentType()
focal_class.full_signature: @Override protected String getContentType()
focal_class.identifier: getContentType
focal_class.modifiers: @Override protected
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getContentType()
focal_class.class_method_signature: GoogleCloudStorageWriteChannel.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: GoogleCloudStorageWriteChannel.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 AbstractGoogleAsyncWriteChannel<Insert, StorageObject>
focal_method.body: @Override
    public Insert createRequest(InputStreamContent inputStream) throws IOException {
      // Create object with the given name and metadata.
      StorageObject object =
          new StorageObject()
              .setContentEncoding(createOptions.getContentEncoding())
              .setMetadata(encodeMetadata(createOptions.getMetadata()))
              .setName(resourceId.getObjectName());
  
      Insert insert =
          gcs.objects()
              .insert(resourceId.getBucketName(), object, inputStream)
              .setName(resourceId.getObjectName())
              .setKmsKeyName(createOptions.getKmsKeyName());
      writeConditions.apply(insert);
      if (insert.getMediaHttpUploader() != null) {
        insert
            .getMediaHttpUploader()
            .setDirectUploadEnabled(isDirectUploadEnabled())
            .setProgressListener(
                new LoggingMediaHttpUploaderProgressListener(
                    resourceId.getObjectName(), MIN_LOGGING_INTERVAL_MS));
      }
      return insert;
    }
focal_method.class_method_signature: GoogleCloudStorageWriteChannel.createRequest(InputStreamContent inputStream)
focal_method.full_signature: @Override public Insert createRequest(InputStreamContent inputStream)
focal_method.identifier: createRequest
focal_method.invocations: setName setMetadata setContentEncoding getContentEncoding encodeMetadata getMetadata getObjectName setKmsKeyName setName insert objects getBucketName getObjectName getKmsKeyName apply getMediaHttpUploader setProgressListener setDirectUploadEnabled getMediaHttpUploader isDirectUploadEnabled getObjectName
focal_method.modifiers: @Override public
focal_method.parameters: (InputStreamContent inputStream)
focal_method.return: Insert
focal_method.signature: Insert createRequest(InputStreamContent inputStream)