test_class.declarator: EMPTY_OBJECT_MD5 = Hashing.md5().hashBytes(new byte[0])
test_class.modifier: private static final
test_class.original_string: private static final HashCode EMPTY_OBJECT_MD5 = Hashing.md5().hashBytes(new byte[0]);
test_class.type: HashCode
test_class.var_name: EMPTY_OBJECT_MD5
test_class.declarator: EMPTY_OBJECT_CRC32C = Hashing.crc32c().hashBytes(new byte[0])
test_class.modifier: private static final
test_class.original_string: private static final HashCode EMPTY_OBJECT_CRC32C = Hashing.crc32c().hashBytes(new byte[0]);
test_class.type: HashCode
test_class.var_name: EMPTY_OBJECT_CRC32C
test_class.declarator: TEST_METADATA =
        ImmutableMap.of("test_key", new byte[] {2})
test_class.modifier: private static final
test_class.original_string: private static final ImmutableMap<String, byte[]> TEST_METADATA =
        ImmutableMap.of("test_key", new byte[] {2});
test_class.type: ImmutableMap<String, byte[]>
test_class.var_name: TEST_METADATA
test_class.declarator: CREATE_BUCKET_OPTIONS =
        CreateBucketOptions.builder()
            .setLocation("test_location")
            .setStorageClass("test_storage_class")
            .build()
test_class.modifier: private static final
test_class.original_string: private static final CreateBucketOptions CREATE_BUCKET_OPTIONS =
        CreateBucketOptions.builder()
            .setLocation("test_location")
            .setStorageClass("test_storage_class")
            .build();
test_class.type: CreateBucketOptions
test_class.var_name: CREATE_BUCKET_OPTIONS
test_class.declarator: CREATE_OBJECT_OPTIONS =
        CreateObjectOptions.DEFAULT_OVERWRITE.toBuilder()
            .setContentType("test_content_type")
            .setMetadata(TEST_METADATA)
            .build()
test_class.modifier: private static final
test_class.original_string: private static final CreateObjectOptions CREATE_OBJECT_OPTIONS =
        CreateObjectOptions.DEFAULT_OVERWRITE.toBuilder()
            .setContentType("test_content_type")
            .setMetadata(TEST_METADATA)
            .build();
test_class.type: CreateObjectOptions
test_class.var_name: CREATE_OBJECT_OPTIONS
test_class.declarator: BUCKET_A = "alpha"
test_class.modifier: private static final
test_class.original_string: private static final String BUCKET_A = "alpha";
test_class.type: String
test_class.var_name: BUCKET_A
test_class.declarator: BUCKET_B = "alph"
test_class.modifier: private static final
test_class.original_string: private static final String BUCKET_B = "alph";
test_class.type: String
test_class.var_name: BUCKET_B
test_class.declarator: PREFIX_A = "bar"
test_class.modifier: private static final
test_class.original_string: private static final String PREFIX_A = "bar";
test_class.type: String
test_class.var_name: PREFIX_A
test_class.declarator: PREFIX_AA = "bar/apple"
test_class.modifier: private static final
test_class.original_string: private static final String PREFIX_AA = "bar/apple";
test_class.type: String
test_class.var_name: PREFIX_AA
test_class.declarator: PREFIX_ABA = "bar/berry/foo"
test_class.modifier: private static final
test_class.original_string: private static final String PREFIX_ABA = "bar/berry/foo";
test_class.type: String
test_class.var_name: PREFIX_ABA
test_class.declarator: PREFIX_B = "baz"
test_class.modifier: private static final
test_class.original_string: private static final String PREFIX_B = "baz";
test_class.type: String
test_class.var_name: PREFIX_B
test_class.declarator: ITEM_A = createBucketItemInfo(BUCKET_A)
test_class.modifier: private static final
test_class.original_string: private static final GoogleCloudStorageItemInfo ITEM_A = createBucketItemInfo(BUCKET_A);
test_class.type: GoogleCloudStorageItemInfo
test_class.var_name: ITEM_A
test_class.declarator: ITEM_B = createBucketItemInfo(BUCKET_B)
test_class.modifier: private static final
test_class.original_string: private static final GoogleCloudStorageItemInfo ITEM_B = createBucketItemInfo(BUCKET_B);
test_class.type: GoogleCloudStorageItemInfo
test_class.var_name: ITEM_B
test_class.declarator: ITEM_A_A =
        createObjectItemInfo(BUCKET_A, PREFIX_A)
test_class.modifier: private static final
test_class.original_string: private static final GoogleCloudStorageItemInfo ITEM_A_A =
        createObjectItemInfo(BUCKET_A, PREFIX_A);
test_class.type: GoogleCloudStorageItemInfo
test_class.var_name: ITEM_A_A
test_class.declarator: ITEM_A_AA =
        createObjectItemInfo(BUCKET_A, PREFIX_AA)
test_class.modifier: private static final
test_class.original_string: private static final GoogleCloudStorageItemInfo ITEM_A_AA =
        createObjectItemInfo(BUCKET_A, PREFIX_AA);
test_class.type: GoogleCloudStorageItemInfo
test_class.var_name: ITEM_A_AA
test_class.declarator: ITEM_A_ABA =
        createObjectItemInfo(BUCKET_A, PREFIX_ABA)
test_class.modifier: private static final
test_class.original_string: private static final GoogleCloudStorageItemInfo ITEM_A_ABA =
        createObjectItemInfo(BUCKET_A, PREFIX_ABA);
test_class.type: GoogleCloudStorageItemInfo
test_class.var_name: ITEM_A_ABA
test_class.declarator: ITEM_A_B =
        createObjectItemInfo(BUCKET_A, PREFIX_B)
test_class.modifier: private static final
test_class.original_string: private static final GoogleCloudStorageItemInfo ITEM_A_B =
        createObjectItemInfo(BUCKET_A, PREFIX_B);
test_class.type: GoogleCloudStorageItemInfo
test_class.var_name: ITEM_A_B
test_class.declarator: ITEM_B_A =
        createObjectItemInfo(BUCKET_B, PREFIX_A)
test_class.modifier: private static final
test_class.original_string: private static final GoogleCloudStorageItemInfo ITEM_B_A =
        createObjectItemInfo(BUCKET_B, PREFIX_A);
test_class.type: GoogleCloudStorageItemInfo
test_class.var_name: ITEM_B_A
test_class.declarator: ITEM_B_B =
        createObjectItemInfo(BUCKET_B, PREFIX_B)
test_class.modifier: private static final
test_class.original_string: private static final GoogleCloudStorageItemInfo ITEM_B_B =
        createObjectItemInfo(BUCKET_B, PREFIX_B);
test_class.type: GoogleCloudStorageItemInfo
test_class.var_name: ITEM_B_B
test_class.declarator: clock
test_class.modifier: private
test_class.original_string: private TestClock clock;
test_class.type: TestClock
test_class.var_name: clock
test_class.declarator: gcs
test_class.modifier: private
test_class.original_string: private PerformanceCachingGoogleCloudStorage gcs;
test_class.type: PerformanceCachingGoogleCloudStorage
test_class.var_name: gcs
test_class.declarator: cache
test_class.modifier: private
test_class.original_string: private PrefixMappedItemCache cache;
test_class.type: PrefixMappedItemCache
test_class.var_name: cache
test_class.declarator: gcsDelegate
test_class.modifier: private
test_class.original_string: private GoogleCloudStorage gcsDelegate;
test_class.type: GoogleCloudStorage
test_class.var_name: gcsDelegate
test_class.file: gcsio/src/test/java/com/google/cloud/hadoop/gcsio/PerformanceCachingGoogleCloudStorageTest.java
test_class.identifier: PerformanceCachingGoogleCloudStorageTest
test_case.body: @Test
    public void testGetItemInfosAllCached() throws IOException {
      List<StorageResourceId> requestedIds =
          Lists.newArrayList(ITEM_A_A.getResourceId(), ITEM_A_B.getResourceId());
      List<GoogleCloudStorageItemInfo> expected = Lists.newArrayList(ITEM_A_A, ITEM_A_B);
  
      // Prepare the cache.
      cache.putItem(ITEM_A_A);
      cache.putItem(ITEM_A_B);
  
      List<GoogleCloudStorageItemInfo> result = gcs.getItemInfos(requestedIds);
  
      // Verify the result is exactly what the delegate returns in order.
      assertThat(result).containsExactlyElementsIn(expected).inOrder();
      // Verify the state of the cache.
      assertThat(cache.getAllItemsRaw()).containsExactlyElementsIn(expected);
    }
test_case.class_method_signature: PerformanceCachingGoogleCloudStorageTest.testGetItemInfosAllCached()
test_case.full_signature: @Test public void testGetItemInfosAllCached()
test_case.identifier: testGetItemInfosAllCached
test_case.invocations: newArrayList getResourceId getResourceId newArrayList putItem putItem getItemInfos inOrder containsExactlyElementsIn assertThat containsExactlyElementsIn assertThat getAllItemsRaw
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGetItemInfosAllCached()
focal_class.declarator: cache
focal_class.modifier: private final
focal_class.original_string: private final PrefixMappedItemCache cache;
focal_class.type: PrefixMappedItemCache
focal_class.var_name: cache
focal_class.file: gcsio/src/main/java/com/google/cloud/hadoop/gcsio/PerformanceCachingGoogleCloudStorage.java
focal_class.identifier: PerformanceCachingGoogleCloudStorage
focal_class.class_method_signature: PerformanceCachingGoogleCloudStorage.PerformanceCachingGoogleCloudStorage(
        GoogleCloudStorage delegate, PerformanceCachingGoogleCloudStorageOptions options)
focal_class.full_signature: public  PerformanceCachingGoogleCloudStorage(
        GoogleCloudStorage delegate, PerformanceCachingGoogleCloudStorageOptions options)
focal_class.identifier: PerformanceCachingGoogleCloudStorage
focal_class.modifiers: public
focal_class.parameters: (
        GoogleCloudStorage delegate, PerformanceCachingGoogleCloudStorageOptions options)
focal_class.signature:  PerformanceCachingGoogleCloudStorage(
        GoogleCloudStorage delegate, PerformanceCachingGoogleCloudStorageOptions options)
focal_class.class_method_signature: PerformanceCachingGoogleCloudStorage.PerformanceCachingGoogleCloudStorage(
        GoogleCloudStorage delegate,
        PrefixMappedItemCache cache)
focal_class.full_signature: @VisibleForTesting  PerformanceCachingGoogleCloudStorage(
        GoogleCloudStorage delegate,
        PrefixMappedItemCache cache)
focal_class.identifier: PerformanceCachingGoogleCloudStorage
focal_class.modifiers: @VisibleForTesting
focal_class.parameters: (
        GoogleCloudStorage delegate,
        PrefixMappedItemCache cache)
focal_class.signature:  PerformanceCachingGoogleCloudStorage(
        GoogleCloudStorage delegate,
        PrefixMappedItemCache cache)
focal_class.class_method_signature: PerformanceCachingGoogleCloudStorage.createCache(
        PerformanceCachingGoogleCloudStorageOptions options)
focal_class.full_signature: private static PrefixMappedItemCache createCache(
        PerformanceCachingGoogleCloudStorageOptions options)
focal_class.identifier: createCache
focal_class.modifiers: private static
focal_class.parameters: (
        PerformanceCachingGoogleCloudStorageOptions options)
focal_class.return: PrefixMappedItemCache
focal_class.signature: PrefixMappedItemCache createCache(
        PerformanceCachingGoogleCloudStorageOptions options)
focal_class.class_method_signature: PerformanceCachingGoogleCloudStorage.create(StorageResourceId resourceId)
focal_class.full_signature: @Override public WritableByteChannel create(StorageResourceId resourceId)
focal_class.identifier: create
focal_class.modifiers: @Override public
focal_class.parameters: (StorageResourceId resourceId)
focal_class.return: WritableByteChannel
focal_class.signature: WritableByteChannel create(StorageResourceId resourceId)
focal_class.class_method_signature: PerformanceCachingGoogleCloudStorage.deleteBuckets(List<String> bucketNames)
focal_class.full_signature: @Override public void deleteBuckets(List<String> bucketNames)
focal_class.identifier: deleteBuckets
focal_class.modifiers: @Override public
focal_class.parameters: (List<String> bucketNames)
focal_class.return: void
focal_class.signature: void deleteBuckets(List<String> bucketNames)
focal_class.class_method_signature: PerformanceCachingGoogleCloudStorage.deleteObjects(List<StorageResourceId> resourceIds)
focal_class.full_signature: @Override public void deleteObjects(List<StorageResourceId> resourceIds)
focal_class.identifier: deleteObjects
focal_class.modifiers: @Override public
focal_class.parameters: (List<StorageResourceId> resourceIds)
focal_class.return: void
focal_class.signature: void deleteObjects(List<StorageResourceId> resourceIds)
focal_class.class_method_signature: PerformanceCachingGoogleCloudStorage.listBucketInfo()
focal_class.full_signature: @Override public List<GoogleCloudStorageItemInfo> listBucketInfo()
focal_class.identifier: listBucketInfo
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: List<GoogleCloudStorageItemInfo>
focal_class.signature: List<GoogleCloudStorageItemInfo> listBucketInfo()
focal_class.class_method_signature: PerformanceCachingGoogleCloudStorage.listObjectNames(String bucketName, String objectNamePrefix)
focal_class.full_signature: @Override public List<String> listObjectNames(String bucketName, String objectNamePrefix)
focal_class.identifier: listObjectNames
focal_class.modifiers: @Override public
focal_class.parameters: (String bucketName, String objectNamePrefix)
focal_class.return: List<String>
focal_class.signature: List<String> listObjectNames(String bucketName, String objectNamePrefix)
focal_class.class_method_signature: PerformanceCachingGoogleCloudStorage.listObjectNames(
        String bucketName, String objectNamePrefix, ListObjectOptions listOptions)
focal_class.full_signature: @Override public List<String> listObjectNames(
        String bucketName, String objectNamePrefix, ListObjectOptions listOptions)
focal_class.identifier: listObjectNames
focal_class.modifiers: @Override public
focal_class.parameters: (
        String bucketName, String objectNamePrefix, ListObjectOptions listOptions)
focal_class.return: List<String>
focal_class.signature: List<String> listObjectNames(
        String bucketName, String objectNamePrefix, ListObjectOptions listOptions)
focal_class.class_method_signature: PerformanceCachingGoogleCloudStorage.listObjectInfo(String bucketName, String objectNamePrefix)
focal_class.full_signature: @Override public List<GoogleCloudStorageItemInfo> listObjectInfo(String bucketName, String objectNamePrefix)
focal_class.identifier: listObjectInfo
focal_class.modifiers: @Override public
focal_class.parameters: (String bucketName, String objectNamePrefix)
focal_class.return: List<GoogleCloudStorageItemInfo>
focal_class.signature: List<GoogleCloudStorageItemInfo> listObjectInfo(String bucketName, String objectNamePrefix)
focal_class.class_method_signature: PerformanceCachingGoogleCloudStorage.listObjectInfo(
        String bucketName, String objectNamePrefix, ListObjectOptions listOptions)
focal_class.full_signature: @Override public List<GoogleCloudStorageItemInfo> listObjectInfo(
        String bucketName, String objectNamePrefix, ListObjectOptions listOptions)
focal_class.identifier: listObjectInfo
focal_class.modifiers: @Override public
focal_class.parameters: (
        String bucketName, String objectNamePrefix, ListObjectOptions listOptions)
focal_class.return: List<GoogleCloudStorageItemInfo>
focal_class.signature: List<GoogleCloudStorageItemInfo> listObjectInfo(
        String bucketName, String objectNamePrefix, ListObjectOptions listOptions)
focal_class.class_method_signature: PerformanceCachingGoogleCloudStorage.listObjectInfoPage(
        String bucketName, String objectNamePrefix, ListObjectOptions listOptions, String pageToken)
focal_class.full_signature: @Override public ListPage<GoogleCloudStorageItemInfo> listObjectInfoPage(
        String bucketName, String objectNamePrefix, ListObjectOptions listOptions, String pageToken)
focal_class.identifier: listObjectInfoPage
focal_class.modifiers: @Override public
focal_class.parameters: (
        String bucketName, String objectNamePrefix, ListObjectOptions listOptions, String pageToken)
focal_class.return: ListPage<GoogleCloudStorageItemInfo>
focal_class.signature: ListPage<GoogleCloudStorageItemInfo> listObjectInfoPage(
        String bucketName, String objectNamePrefix, ListObjectOptions listOptions, String pageToken)
focal_class.class_method_signature: PerformanceCachingGoogleCloudStorage.getItemInfo(StorageResourceId resourceId)
focal_class.full_signature: @Override public GoogleCloudStorageItemInfo getItemInfo(StorageResourceId resourceId)
focal_class.identifier: getItemInfo
focal_class.modifiers: @Override public
focal_class.parameters: (StorageResourceId resourceId)
focal_class.return: GoogleCloudStorageItemInfo
focal_class.signature: GoogleCloudStorageItemInfo getItemInfo(StorageResourceId resourceId)
focal_class.class_method_signature: PerformanceCachingGoogleCloudStorage.getItemInfos(List<StorageResourceId> resourceIds)
focal_class.full_signature: @Override public List<GoogleCloudStorageItemInfo> getItemInfos(List<StorageResourceId> resourceIds)
focal_class.identifier: getItemInfos
focal_class.modifiers: @Override public
focal_class.parameters: (List<StorageResourceId> resourceIds)
focal_class.return: List<GoogleCloudStorageItemInfo>
focal_class.signature: List<GoogleCloudStorageItemInfo> getItemInfos(List<StorageResourceId> resourceIds)
focal_class.class_method_signature: PerformanceCachingGoogleCloudStorage.updateItems(List<UpdatableItemInfo> itemInfoList)
focal_class.full_signature: @Override public List<GoogleCloudStorageItemInfo> updateItems(List<UpdatableItemInfo> itemInfoList)
focal_class.identifier: updateItems
focal_class.modifiers: @Override public
focal_class.parameters: (List<UpdatableItemInfo> itemInfoList)
focal_class.return: List<GoogleCloudStorageItemInfo>
focal_class.signature: List<GoogleCloudStorageItemInfo> updateItems(List<UpdatableItemInfo> itemInfoList)
focal_class.class_method_signature: PerformanceCachingGoogleCloudStorage.close()
focal_class.full_signature: @Override public void close()
focal_class.identifier: close
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void close()
focal_class.class_method_signature: PerformanceCachingGoogleCloudStorage.composeObjects(
        List<StorageResourceId> sources, StorageResourceId destination, CreateObjectOptions options)
focal_class.full_signature: @Override public GoogleCloudStorageItemInfo composeObjects(
        List<StorageResourceId> sources, StorageResourceId destination, CreateObjectOptions options)
focal_class.identifier: composeObjects
focal_class.modifiers: @Override public
focal_class.parameters: (
        List<StorageResourceId> sources, StorageResourceId destination, CreateObjectOptions options)
focal_class.return: GoogleCloudStorageItemInfo
focal_class.signature: GoogleCloudStorageItemInfo composeObjects(
        List<StorageResourceId> sources, StorageResourceId destination, CreateObjectOptions options)
focal_class.class_method_signature: PerformanceCachingGoogleCloudStorage.invalidateCache()
focal_class.full_signature: @VisibleForTesting public void invalidateCache()
focal_class.identifier: invalidateCache
focal_class.modifiers: @VisibleForTesting public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void invalidateCache()
focal_class.superclass: extends ForwardingGoogleCloudStorage
focal_method.body: @Override
    public List<GoogleCloudStorageItemInfo> getItemInfos(List<StorageResourceId> resourceIds)
        throws IOException {
      List<GoogleCloudStorageItemInfo> result = new ArrayList<>(resourceIds.size());
      List<StorageResourceId> request = new ArrayList<>(resourceIds.size());
  
      // Populate the result list with items in the cache, and the request list with resources that
      // still need to be resolved. Null items are added to the result list to preserve ordering.
      for (StorageResourceId resourceId : resourceIds) {
        GoogleCloudStorageItemInfo item = cache.getItem(resourceId);
        if (item == null) {
          request.add(resourceId);
        }
        result.add(item);
      }
  
      // Resolve all the resources which were not cached, cache them, and add them to the result list.
      // Null entries in the result list are replaced by the fresh entries from the underlying
      // GoogleCloudStorage.
      if (!request.isEmpty()) {
        List<GoogleCloudStorageItemInfo> response = super.getItemInfos(request);
        Iterator<GoogleCloudStorageItemInfo> responseIterator = response.iterator();
  
        // Iterate through the result set, replacing the null entries added previously with entries
        // from the response.
        for (int i = 0; i < result.size() && responseIterator.hasNext(); i++) {
          if (result.get(i) == null) {
            GoogleCloudStorageItemInfo item = responseIterator.next();
            cache.putItem(item);
            result.set(i, item);
          }
        }
      }
  
      return result;
    }
focal_method.class_method_signature: PerformanceCachingGoogleCloudStorage.getItemInfos(List<StorageResourceId> resourceIds)
focal_method.full_signature: @Override public List<GoogleCloudStorageItemInfo> getItemInfos(List<StorageResourceId> resourceIds)
focal_method.identifier: getItemInfos
focal_method.invocations: size size getItem add add isEmpty getItemInfos iterator size hasNext get next putItem set
focal_method.modifiers: @Override public
focal_method.parameters: (List<StorageResourceId> resourceIds)
focal_method.return: List<GoogleCloudStorageItemInfo>
focal_method.signature: List<GoogleCloudStorageItemInfo> getItemInfos(List<StorageResourceId> resourceIds)