test_class.declarator: LOG = LoggerFactory.getLogger(TestS3DataStore.class)
test_class.modifier: protected static final
test_class.original_string: protected static final Logger LOG = LoggerFactory.getLogger(TestS3DataStore.class);
test_class.type: Logger
test_class.var_name: LOG
test_class.declarator: expectedEx = ExpectedException.none()
test_class.modifier: @Rule
      public
test_class.original_string: @Rule
      public ExpectedException expectedEx = ExpectedException.none();
test_class.type: ExpectedException
test_class.var_name: expectedEx
test_class.declarator: folder = new TemporaryFolder(new File("target"))
test_class.modifier: @Rule
      public
test_class.original_string: @Rule
      public TemporaryFolder folder = new TemporaryFolder(new File("target"));
test_class.type: TemporaryFolder
test_class.var_name: folder
test_class.declarator: props
test_class.modifier: private
test_class.original_string: private Properties props;
test_class.type: Properties
test_class.var_name: props
test_class.declarator: s3Class
test_class.modifier: @Parameterized.Parameter
      public
test_class.original_string: @Parameterized.Parameter
      public String s3Class;
test_class.type: String
test_class.var_name: s3Class
test_class.declarator: dataStoreDir
test_class.modifier: private
test_class.original_string: private File dataStoreDir;
test_class.type: File
test_class.var_name: dataStoreDir
test_class.declarator: ds
test_class.modifier: private
test_class.original_string: private DataStore ds;
test_class.type: DataStore
test_class.var_name: ds
test_class.declarator: startTime
test_class.modifier: private
test_class.original_string: private Date startTime;
test_class.type: Date
test_class.var_name: startTime
test_class.declarator: bucket
test_class.modifier: private
test_class.original_string: private String bucket;
test_class.type: String
test_class.var_name: bucket
test_class.file: oak-blob-cloud/src/test/java/org/apache/jackrabbit/oak/blob/cloud/s3/TestS3DataStore.java
test_class.identifier: TestS3DataStore
test_case.body: @Test
      public void testSecret() throws Exception {
          assumeTrue(isS3Configured());
  
          Random randomGen = new Random();
          props = S3DataStoreUtils.getS3Config();
          props.put("cacheSize", "0");
          ds = getS3DataStore(s3Class, props, dataStoreDir.getAbsolutePath());
          bucket = props.getProperty(S3Constants.S3_BUCKET);
  
          byte[] data = new byte[4096];
          randomGen.nextBytes(data);
          DataRecord rec = ds.addRecord(new ByteArrayInputStream(data));
          assertEquals(data.length, rec.getLength());
          String ref = rec.getReference();
          assertNotNull(ref);
  
          String id = rec.getIdentifier().toString();
  
          S3DataStore s3 = ((S3DataStore) ds);
          byte[] refKey = ((S3Backend) s3.getBackend()).getOrCreateReferenceKey();
  
          Mac mac = Mac.getInstance("HmacSHA1");
          mac.init(new SecretKeySpec(refKey, "HmacSHA1"));
          byte[] hash = mac.doFinal(id.getBytes("UTF-8"));
          String calcRef = id + ':' + encodeHexString(hash);
  
          assertEquals("getReference() not equal", calcRef, ref);
  
          DataRecord refRec = s3.getMetadataRecord("reference.key");
          assertNotNull("Reference data record null", refRec);
  
          byte[] refDirectFromBackend = IOUtils.toByteArray(refRec.getStream());
          LOG.warn("Ref direct from backend {}", refDirectFromBackend);
          assertTrue("refKey in memory not equal to the metadata record",
              Arrays.equals(refKey, refDirectFromBackend));
      }
test_case.class_method_signature: TestS3DataStore.testSecret()
test_case.full_signature: @Test public void testSecret()
test_case.identifier: testSecret
test_case.invocations: assumeTrue isS3Configured getS3Config put getS3DataStore getAbsolutePath getProperty nextBytes addRecord assertEquals getLength getReference assertNotNull toString getIdentifier getOrCreateReferenceKey getBackend getInstance init doFinal getBytes encodeHexString assertEquals getMetadataRecord assertNotNull toByteArray getStream warn assertTrue equals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testSecret()
focal_class.declarator: properties
focal_class.modifier: protected
focal_class.original_string: protected Properties properties;
focal_class.type: Properties
focal_class.var_name: properties
focal_class.declarator: s3Backend
focal_class.modifier: private
focal_class.original_string: private S3Backend s3Backend;
focal_class.type: S3Backend
focal_class.var_name: s3Backend
focal_class.declarator: minRecordLength = 16 * 1024
focal_class.modifier: private
focal_class.original_string: private int minRecordLength = 16 * 1024;
focal_class.type: int
focal_class.var_name: minRecordLength
focal_class.file: oak-blob-cloud/src/main/java/org/apache/jackrabbit/oak/blob/cloud/s3/S3DataStore.java
focal_class.identifier: S3DataStore
focal_class.interfaces: implements ConfigurableDataRecordAccessProvider
focal_class.class_method_signature: S3DataStore.createBackend()
focal_class.full_signature: @Override protected AbstractSharedBackend createBackend()
focal_class.identifier: createBackend
focal_class.modifiers: @Override protected
focal_class.parameters: ()
focal_class.return: AbstractSharedBackend
focal_class.signature: AbstractSharedBackend createBackend()
focal_class.class_method_signature: S3DataStore.setProperties(Properties properties)
focal_class.full_signature: public void setProperties(Properties properties)
focal_class.identifier: setProperties
focal_class.modifiers: public
focal_class.parameters: (Properties properties)
focal_class.return: void
focal_class.signature: void setProperties(Properties properties)
focal_class.class_method_signature: S3DataStore.getBackend()
focal_class.full_signature: public SharedBackend getBackend()
focal_class.identifier: getBackend
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: SharedBackend
focal_class.signature: SharedBackend getBackend()
focal_class.class_method_signature: S3DataStore.getMinRecordLength()
focal_class.full_signature: @Override public int getMinRecordLength()
focal_class.identifier: getMinRecordLength
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int getMinRecordLength()
focal_class.class_method_signature: S3DataStore.setMinRecordLength(int minRecordLength)
focal_class.full_signature: public void setMinRecordLength(int minRecordLength)
focal_class.identifier: setMinRecordLength
focal_class.modifiers: public
focal_class.parameters: (int minRecordLength)
focal_class.return: void
focal_class.signature: void setMinRecordLength(int minRecordLength)
focal_class.class_method_signature: S3DataStore.setDirectUploadURIExpirySeconds(int seconds)
focal_class.full_signature: @Override public void setDirectUploadURIExpirySeconds(int seconds)
focal_class.identifier: setDirectUploadURIExpirySeconds
focal_class.modifiers: @Override public
focal_class.parameters: (int seconds)
focal_class.return: void
focal_class.signature: void setDirectUploadURIExpirySeconds(int seconds)
focal_class.class_method_signature: S3DataStore.setBinaryTransferAccelerationEnabled(boolean enabled)
focal_class.full_signature: @Override public void setBinaryTransferAccelerationEnabled(boolean enabled)
focal_class.identifier: setBinaryTransferAccelerationEnabled
focal_class.modifiers: @Override public
focal_class.parameters: (boolean enabled)
focal_class.return: void
focal_class.signature: void setBinaryTransferAccelerationEnabled(boolean enabled)
focal_class.class_method_signature: S3DataStore.initiateDataRecordUpload(long maxUploadSizeInBytes, int maxNumberOfURIs)
focal_class.full_signature: @Nullable @Override public DataRecordUpload initiateDataRecordUpload(long maxUploadSizeInBytes, int maxNumberOfURIs)
focal_class.identifier: initiateDataRecordUpload
focal_class.modifiers: @Nullable @Override public
focal_class.parameters: (long maxUploadSizeInBytes, int maxNumberOfURIs)
focal_class.return: DataRecordUpload
focal_class.signature: DataRecordUpload initiateDataRecordUpload(long maxUploadSizeInBytes, int maxNumberOfURIs)
focal_class.class_method_signature: S3DataStore.initiateDataRecordUpload(long maxUploadSizeInBytes, int maxNumberOfURIs, @NotNull final DataRecordUploadOptions options)
focal_class.full_signature: @Nullable @Override public DataRecordUpload initiateDataRecordUpload(long maxUploadSizeInBytes, int maxNumberOfURIs, @NotNull final DataRecordUploadOptions options)
focal_class.identifier: initiateDataRecordUpload
focal_class.modifiers: @Nullable @Override public
focal_class.parameters: (long maxUploadSizeInBytes, int maxNumberOfURIs, @NotNull final DataRecordUploadOptions options)
focal_class.return: DataRecordUpload
focal_class.signature: DataRecordUpload initiateDataRecordUpload(long maxUploadSizeInBytes, int maxNumberOfURIs, @NotNull final DataRecordUploadOptions options)
focal_class.class_method_signature: S3DataStore.completeDataRecordUpload(@NotNull String uploadToken)
focal_class.full_signature: @NotNull @Override public DataRecord completeDataRecordUpload(@NotNull String uploadToken)
focal_class.identifier: completeDataRecordUpload
focal_class.modifiers: @NotNull @Override public
focal_class.parameters: (@NotNull String uploadToken)
focal_class.return: DataRecord
focal_class.signature: DataRecord completeDataRecordUpload(@NotNull String uploadToken)
focal_class.class_method_signature: S3DataStore.setDirectDownloadURIExpirySeconds(int seconds)
focal_class.full_signature: @Override public void setDirectDownloadURIExpirySeconds(int seconds)
focal_class.identifier: setDirectDownloadURIExpirySeconds
focal_class.modifiers: @Override public
focal_class.parameters: (int seconds)
focal_class.return: void
focal_class.signature: void setDirectDownloadURIExpirySeconds(int seconds)
focal_class.class_method_signature: S3DataStore.setDirectDownloadURICacheSize(int maxSize)
focal_class.full_signature: @Override public void setDirectDownloadURICacheSize(int maxSize)
focal_class.identifier: setDirectDownloadURICacheSize
focal_class.modifiers: @Override public
focal_class.parameters: (int maxSize)
focal_class.return: void
focal_class.signature: void setDirectDownloadURICacheSize(int maxSize)
focal_class.class_method_signature: S3DataStore.getDownloadURI(@NotNull DataIdentifier identifier,
                                @NotNull DataRecordDownloadOptions downloadOptions)
focal_class.full_signature: @Nullable @Override public URI getDownloadURI(@NotNull DataIdentifier identifier,
                                @NotNull DataRecordDownloadOptions downloadOptions)
focal_class.identifier: getDownloadURI
focal_class.modifiers: @Nullable @Override public
focal_class.parameters: (@NotNull DataIdentifier identifier,
                                @NotNull DataRecordDownloadOptions downloadOptions)
focal_class.return: URI
focal_class.signature: URI getDownloadURI(@NotNull DataIdentifier identifier,
                                @NotNull DataRecordDownloadOptions downloadOptions)
focal_class.superclass: extends AbstractSharedCachingDataStore
focal_method.body: public SharedBackend getBackend() {
          return backend;
      }
focal_method.class_method_signature: S3DataStore.getBackend()
focal_method.full_signature: public SharedBackend getBackend()
focal_method.identifier: getBackend
focal_method.modifiers: public
focal_method.parameters: ()
focal_method.return: SharedBackend
focal_method.signature: SharedBackend getBackend()