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: archiveManager
test_class.modifier: protected
test_class.original_string: protected SegmentArchiveManager archiveManager;
test_class.type: SegmentArchiveManager
test_class.var_name: archiveManager
test_class.declarator: monitor
test_class.modifier: protected
test_class.original_string: protected TestFileStoreMonitor monitor;
test_class.type: TestFileStoreMonitor
test_class.var_name: monitor
test_class.file: oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/file/tar/TarWriterTest.java
test_class.identifier: TarWriterTest
test_case.body: @Test
      public void createNextGenerationTest() throws IOException {
          int counter = 2222;
          TarWriter t0 = new TarWriter(archiveManager, counter, NoopStats.INSTANCE);
  
          // not dirty, will not create a new writer
          TarWriter t1 = t0.createNextGeneration();
          assertEquals(t0, t1);
          assertTrue(t1.getFileName().contains("" + counter));
  
          // dirty, will create a new writer
          UUID id = UUID.randomUUID();
          long msb = id.getMostSignificantBits();
          long lsb = id.getLeastSignificantBits() & (-1 >>> 4); // OAK-1672
          byte[] data = "Hello, World!".getBytes(UTF_8);
          t1.writeEntry(msb, lsb, data, 0, data.length, newGCGeneration(0, 0, false));
  
          TarWriter t2 = t1.createNextGeneration();
          assertNotEquals(t1, t2);
          assertTrue(t1.isClosed());
          assertTrue(t2.getFileName().contains("" + (counter + 1)));
      }
test_case.class_method_signature: TarWriterTest.createNextGenerationTest()
test_case.full_signature: @Test public void createNextGenerationTest()
test_case.identifier: createNextGenerationTest
test_case.invocations: createNextGeneration assertEquals assertTrue contains getFileName randomUUID getMostSignificantBits getLeastSignificantBits getBytes writeEntry newGCGeneration createNextGeneration assertNotEquals assertTrue isClosed assertTrue contains getFileName
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void createNextGenerationTest()
focal_class.declarator: log = LoggerFactory.getLogger(TarWriter.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger log = LoggerFactory.getLogger(TarWriter.class);
focal_class.type: Logger
focal_class.var_name: log
focal_class.declarator: writeIndex
focal_class.modifier: private final
focal_class.original_string: private final int writeIndex;
focal_class.type: int
focal_class.var_name: writeIndex
focal_class.declarator: closed = false
focal_class.modifier: private
focal_class.original_string: private boolean closed = false;
focal_class.type: boolean
focal_class.var_name: closed
focal_class.declarator: binaryReferences = newBinaryReferencesIndexWriter()
focal_class.modifier: private final
focal_class.original_string: private final BinaryReferencesIndexWriter binaryReferences = newBinaryReferencesIndexWriter();
focal_class.type: BinaryReferencesIndexWriter
focal_class.var_name: binaryReferences
focal_class.declarator: graph = newHashMap()
focal_class.modifier: private final
focal_class.original_string: private final Map<UUID, Set<UUID>> graph = newHashMap();
focal_class.type: Map<UUID, Set<UUID>>
focal_class.var_name: graph
focal_class.declarator: archiveManager
focal_class.modifier: private final
focal_class.original_string: private final SegmentArchiveManager archiveManager;
focal_class.type: SegmentArchiveManager
focal_class.var_name: archiveManager
focal_class.declarator: archive
focal_class.modifier: private final
focal_class.original_string: private final SegmentArchiveWriter archive;
focal_class.type: SegmentArchiveWriter
focal_class.var_name: archive
focal_class.declarator: closeMonitor = new Object()
focal_class.modifier: private final
focal_class.original_string: private final Object closeMonitor = new Object();
focal_class.type: Object
focal_class.var_name: closeMonitor
focal_class.declarator: segmentCount
focal_class.modifier: private final
focal_class.original_string: private final CounterStats segmentCount;
focal_class.type: CounterStats
focal_class.var_name: segmentCount
focal_class.file: oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/tar/TarWriter.java
focal_class.identifier: TarWriter
focal_class.interfaces: implements Closeable
focal_class.class_method_signature: TarWriter.TarWriter(SegmentArchiveManager archiveManager, String archiveName)
focal_class.full_signature:   TarWriter(SegmentArchiveManager archiveManager, String archiveName)
focal_class.identifier: TarWriter
focal_class.parameters: (SegmentArchiveManager archiveManager, String archiveName)
focal_class.signature:  TarWriter(SegmentArchiveManager archiveManager, String archiveName)
focal_class.class_method_signature: TarWriter.TarWriter(SegmentArchiveManager archiveManager, int writeIndex, CounterStats segmentCountStats)
focal_class.full_signature:   TarWriter(SegmentArchiveManager archiveManager, int writeIndex, CounterStats segmentCountStats)
focal_class.identifier: TarWriter
focal_class.parameters: (SegmentArchiveManager archiveManager, int writeIndex, CounterStats segmentCountStats)
focal_class.signature:  TarWriter(SegmentArchiveManager archiveManager, int writeIndex, CounterStats segmentCountStats)
focal_class.class_method_signature: TarWriter.containsEntry(long msb, long lsb)
focal_class.full_signature: synchronized boolean containsEntry(long msb, long lsb)
focal_class.identifier: containsEntry
focal_class.modifiers: synchronized
focal_class.parameters: (long msb, long lsb)
focal_class.return: boolean
focal_class.signature: boolean containsEntry(long msb, long lsb)
focal_class.class_method_signature: TarWriter.getEntryCount()
focal_class.full_signature:  int getEntryCount()
focal_class.identifier: getEntryCount
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int getEntryCount()
focal_class.class_method_signature: TarWriter.readEntry(long msb, long lsb)
focal_class.full_signature:  Buffer readEntry(long msb, long lsb)
focal_class.identifier: readEntry
focal_class.parameters: (long msb, long lsb)
focal_class.return: Buffer
focal_class.signature: Buffer readEntry(long msb, long lsb)
focal_class.class_method_signature: TarWriter.writeEntry(long msb, long lsb, byte[] data, int offset, int size, GCGeneration generation)
focal_class.full_signature:  long writeEntry(long msb, long lsb, byte[] data, int offset, int size, GCGeneration generation)
focal_class.identifier: writeEntry
focal_class.parameters: (long msb, long lsb, byte[] data, int offset, int size, GCGeneration generation)
focal_class.return: long
focal_class.signature: long writeEntry(long msb, long lsb, byte[] data, int offset, int size, GCGeneration generation)
focal_class.class_method_signature: TarWriter.addBinaryReference(GCGeneration generation, UUID segmentId, String reference)
focal_class.full_signature:  void addBinaryReference(GCGeneration generation, UUID segmentId, String reference)
focal_class.identifier: addBinaryReference
focal_class.parameters: (GCGeneration generation, UUID segmentId, String reference)
focal_class.return: void
focal_class.signature: void addBinaryReference(GCGeneration generation, UUID segmentId, String reference)
focal_class.class_method_signature: TarWriter.addGraphEdge(UUID from, UUID to)
focal_class.full_signature:  void addGraphEdge(UUID from, UUID to)
focal_class.identifier: addGraphEdge
focal_class.parameters: (UUID from, UUID to)
focal_class.return: void
focal_class.signature: void addGraphEdge(UUID from, UUID to)
focal_class.class_method_signature: TarWriter.flush()
focal_class.full_signature:  void flush()
focal_class.identifier: flush
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void flush()
focal_class.class_method_signature: TarWriter.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: TarWriter.createNextGeneration()
focal_class.full_signature:  TarWriter createNextGeneration()
focal_class.identifier: createNextGeneration
focal_class.parameters: ()
focal_class.return: TarWriter
focal_class.signature: TarWriter createNextGeneration()
focal_class.class_method_signature: TarWriter.writeBinaryReferences()
focal_class.full_signature: private void writeBinaryReferences()
focal_class.identifier: writeBinaryReferences
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void writeBinaryReferences()
focal_class.class_method_signature: TarWriter.writeGraph()
focal_class.full_signature: private void writeGraph()
focal_class.identifier: writeGraph
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void writeGraph()
focal_class.class_method_signature: TarWriter.fileLength()
focal_class.full_signature: synchronized long fileLength()
focal_class.identifier: fileLength
focal_class.modifiers: synchronized
focal_class.parameters: ()
focal_class.return: long
focal_class.signature: long fileLength()
focal_class.class_method_signature: TarWriter.getFileName()
focal_class.full_signature: synchronized String getFileName()
focal_class.identifier: getFileName
focal_class.modifiers: synchronized
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getFileName()
focal_class.class_method_signature: TarWriter.isClosed()
focal_class.full_signature: synchronized boolean isClosed()
focal_class.identifier: isClosed
focal_class.modifiers: synchronized
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isClosed()
focal_class.class_method_signature: TarWriter.toString()
focal_class.full_signature: @Override public String toString()
focal_class.identifier: toString
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String toString()
focal_method.body: TarWriter createNextGeneration() throws IOException {
          checkState(writeIndex >= 0);
          // If nothing was written to this file, then we're already done.
          synchronized (this) {
              if (!archive.isCreated()) {
                  return this;
              }
          }
          close();
          int newIndex = writeIndex + 1;
          return new TarWriter(archiveManager, newIndex, segmentCount);
      }
focal_method.class_method_signature: TarWriter.createNextGeneration()
focal_method.full_signature:  TarWriter createNextGeneration()
focal_method.identifier: createNextGeneration
focal_method.invocations: checkState isCreated close
focal_method.parameters: ()
focal_method.return: TarWriter
focal_method.signature: TarWriter createNextGeneration()