hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/web/client/TestKeys.java
private KsmKeyArgs putKey() throws Exception {
      String volumeName = OzoneUtils.getRequestID().toLowerCase();
      client.setUserAuth("hdfs");

      vol = client.createVolume(volumeName, "bilbo", "100TB");
      String[] acls = {"user:frodo:rw", "user:samwise:rw"};

      String bucketName = OzoneUtils.getRequestID().toLowerCase();
      bucket = vol.createBucket(bucketName, acls, StorageType.DEFAULT);

      String fileName = OzoneUtils.getRequestID().toLowerCase();

      file = createRandomDataFile(dir, fileName, 1024);

      bucket.putKey(keyName, file);
      return new KsmKeyArgs.Builder()
          .setKeyName(keyName)
          .setVolumeName(volumeName)
          .setBucketName(bucketName)
          .setDataSize(1024)
          .build();
    }
/**
     * This function is reused in all other tests.
     *
     * @return Returns the name of the new key that was created.
     * @throws OzoneException
     */
This function is reused in all other tests.
@return Returns the name of the new key that was created.
This function is reused in all other tests . @return Returns the name of the new key that was created .
private KsmKeyArgs putKey() throws Exception {
      String volumeName = OzoneUtils.getRequestID().toLowerCase();
      client.setUserAuth("hdfs");
      vol = client.createVolume(volumeName, "bilbo", "100TB");
      String[] acls = {"user:frodo:rw", "user:samwise:rw"};
      String bucketName = OzoneUtils.getRequestID().toLowerCase();
      bucket = vol.createBucket(bucketName, acls, StorageType.DEFAULT);
      String fileName = OzoneUtils.getRequestID().toLowerCase();
      file = createRandomDataFile(dir, fileName, 1024);
      bucket.putKey(keyName, file);
      return new KsmKeyArgs.Builder()
          .setKeyName(keyName)
          .setVolumeName(volumeName)
          .setBucketName(bucketName)
          .setDataSize(1024)
          .build();
    }
private KsmKeyArgs putKey ( ) throws Exception { String volumeName = OzoneUtils . getRequestID ( ) . toLowerCase ( ) ; client . setUserAuth ( "hdfs" ) ; vol = client . createVolume ( volumeName , "bilbo" , "100TB" ) ; String [ ] acls = { "user:frodo:rw" , "user:samwise:rw" } ; String bucketName = OzoneUtils . getRequestID ( ) . toLowerCase ( ) ; bucket = vol . createBucket ( bucketName , acls , StorageType . DEFAULT ) ; String fileName = OzoneUtils . getRequestID ( ) . toLowerCase ( ) ; file = createRandomDataFile ( dir , fileName , 1024 ) ; bucket . putKey ( keyName , file ) ; return new KsmKeyArgs . Builder ( ) . setKeyName ( keyName ) . setVolumeName ( volumeName ) . setBucketName ( bucketName ) . setDataSize ( 1024 ) . build ( ) ; }
This function is reused in all other tests.
This function is reused in all other tests .