test_class.declarator: storeLocation
test_class.modifier: @Value("${dataset.metadata.store.file.location}")
      private
test_class.original_string: @Value("${dataset.metadata.store.file.location}")
      private String storeLocation;
test_class.type: String
test_class.var_name: storeLocation
test_class.declarator: repository
test_class.modifier: @Autowired
      private
test_class.original_string: @Autowired
      private FileSystemDataSetMetadataRepository repository;
test_class.type: FileSystemDataSetMetadataRepository
test_class.var_name: repository
test_class.file: dataprep-dataset/src/test/java/org/talend/dataprep/dataset/store/metadata/file/FileSystemDataSetMetadataRepositoryTest.java
test_class.identifier: FileSystemDataSetMetadataRepositoryTest
test_class.superclass: extends DataSetBaseTest
test_case.body: @Test
      public void testCountAllDataSetsSizeWhenRepoContainsMultipleElements() throws Exception {
          // given
          // info: data set size for test is 120345 in its metadata
          for (int i = 1; i <= 3; i++) {
              repository.save(getMetadata(String.valueOf(i)));
          }
          DataSetMetadata metadataWithDifferentDataSetSize = getMetadata("4");
          metadataWithDifferentDataSetSize.setDataSetSize(5127892);
          repository.save(metadataWithDifferentDataSetSize);
  
          // when
          long totalSize = repository.countAllDataSetsSize();
  
          // then
          assertThat(totalSize, is(5488927L));
      }
test_case.class_method_signature: FileSystemDataSetMetadataRepositoryTest.testCountAllDataSetsSizeWhenRepoContainsMultipleElements()
test_case.full_signature: @Test public void testCountAllDataSetsSizeWhenRepoContainsMultipleElements()
test_case.identifier: testCountAllDataSetsSizeWhenRepoContainsMultipleElements
test_case.invocations: save getMetadata valueOf getMetadata setDataSetSize save countAllDataSetsSize assertThat is
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testCountAllDataSetsSizeWhenRepoContainsMultipleElements()
focal_class.declarator: LOG = LoggerFactory.getLogger(FileSystemDataSetMetadataRepository.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOG = LoggerFactory.getLogger(FileSystemDataSetMetadataRepository.class);
focal_class.type: Logger
focal_class.var_name: LOG
focal_class.declarator: locks = new ReentrantReadWriteLockGroup(true, 100)
focal_class.modifier: private final
focal_class.original_string: private final ReentrantReadWriteLockGroup locks = new ReentrantReadWriteLockGroup(true, 100);
focal_class.type: ReentrantReadWriteLockGroup
focal_class.var_name: locks
focal_class.declarator: mapper
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private ObjectMapper mapper;
focal_class.type: ObjectMapper
focal_class.var_name: mapper
focal_class.declarator: storeLocation
focal_class.modifier: @Value("${dataset.metadata.store.file.location}")
      private
focal_class.original_string: @Value("${dataset.metadata.store.file.location}")
      private String storeLocation;
focal_class.type: String
focal_class.var_name: storeLocation
focal_class.file: dataprep-dataset/src/main/java/org/talend/dataprep/dataset/store/metadata/file/FileSystemDataSetMetadataRepository.java
focal_class.identifier: FileSystemDataSetMetadataRepository
focal_class.class_method_signature: FileSystemDataSetMetadataRepository.init()
focal_class.full_signature: @PostConstruct private void init()
focal_class.identifier: init
focal_class.modifiers: @PostConstruct private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void init()
focal_class.class_method_signature: FileSystemDataSetMetadataRepository.save(DataSetMetadata metadata)
focal_class.full_signature: @Override public void save(DataSetMetadata metadata)
focal_class.identifier: save
focal_class.modifiers: @Override public
focal_class.parameters: (DataSetMetadata metadata)
focal_class.return: void
focal_class.signature: void save(DataSetMetadata metadata)
focal_class.class_method_signature: FileSystemDataSetMetadataRepository.get(String id)
focal_class.full_signature: @Override public DataSetMetadata get(String id)
focal_class.identifier: get
focal_class.modifiers: @Override public
focal_class.parameters: (String id)
focal_class.return: DataSetMetadata
focal_class.signature: DataSetMetadata get(String id)
focal_class.class_method_signature: FileSystemDataSetMetadataRepository.remove(String id)
focal_class.full_signature: @Override public void remove(String id)
focal_class.identifier: remove
focal_class.modifiers: @Override public
focal_class.parameters: (String id)
focal_class.return: void
focal_class.signature: void remove(String id)
focal_class.class_method_signature: FileSystemDataSetMetadataRepository.source()
focal_class.full_signature: @Override public Stream<DataSetMetadata> source()
focal_class.identifier: source
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Stream<DataSetMetadata>
focal_class.signature: Stream<DataSetMetadata> source()
focal_class.class_method_signature: FileSystemDataSetMetadataRepository.getFile(String metadataId)
focal_class.full_signature: private File getFile(String metadataId)
focal_class.identifier: getFile
focal_class.modifiers: private
focal_class.parameters: (String metadataId)
focal_class.return: File
focal_class.signature: File getFile(String metadataId)
focal_class.class_method_signature: FileSystemDataSetMetadataRepository.getRootFolder()
focal_class.full_signature: private File getRootFolder()
focal_class.identifier: getRootFolder
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: File
focal_class.signature: File getRootFolder()
focal_class.superclass: extends ObjectDataSetMetadataRepository
focal_method.body: @Override
      public void save(DataSetMetadata metadata) {
  
          String id = metadata.getId();
  
          ReentrantReadWriteLock lock = locks.getLock(id);
          final File file = getFile(id);
  
          lock.writeLock().lock();
          try (GZIPOutputStream output = new GZIPOutputStream(new FileOutputStream(file))) {
              mapper.writer().writeValue(output, metadata);
          } catch (IOException e) {
              LOG.error("Error saving {}", metadata, e);
              throw new TDPException(DataSetErrorCodes.UNABLE_TO_STORE_DATASET_METADATA, e,
                      ExceptionContext.build().put("id", metadata.getId()));
          } finally {
              lock.writeLock().unlock();
          }
      }
focal_method.class_method_signature: FileSystemDataSetMetadataRepository.save(DataSetMetadata metadata)
focal_method.full_signature: @Override public void save(DataSetMetadata metadata)
focal_method.identifier: save
focal_method.invocations: getId getLock getFile lock writeLock writeValue writer error put build getId unlock writeLock
focal_method.modifiers: @Override public
focal_method.parameters: (DataSetMetadata metadata)
focal_method.return: void
focal_method.signature: void save(DataSetMetadata metadata)