congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
StreamyBytesPersistentOutputStream.getFileName
Code IndexAdd Tabnine to your IDE (free)

How to use
getFileName
method
in
com.ning.billing.meter.timeline.persistent.StreamyBytesPersistentOutputStream

Best Java code snippets using com.ning.billing.meter.timeline.persistent.StreamyBytesPersistentOutputStream.getFileName (Showing top 2 results out of 315)

origin: com.ning.billing/killbill-meter

private void flushUnderlyingBufferAndReset() {
  synchronized (inputBuffer) {
    if (inputBuffer.available() == 0) {
      // Somebody beat you to it
      return;
    }
    final String pathname = getFileName();
    createdFiles.add(pathname);
    log.debug("Flushing in-memory buffer to disk: {}", pathname);
    try {
      final File out = new File(pathname);
      flushToFile(out);
    } catch (IOException e) {
      log.warn("Error flushing data", e);
    } finally {
      reset();
    }
  }
}
origin: com.ning.billing/killbill-meter

  @Test(groups = "slow")
  public void testOrdering() throws Exception {
    Assert.assertTrue(basePath.mkdir());

    final List<String> filePathsCreated = new ArrayList<String>();
    final List<File> filesCreated = new ArrayList<File>();
    final int expected = 50;

    for (int i = 0; i < expected; i++) {
      filePathsCreated.add(outputStream.getFileName());
      Thread.sleep(17);
    }

    // Create the files in the opposite ordering to make sure we can re-read them in order
    for (int i = expected - 1; i >= 0; i--) {
      final File file = new File(filePathsCreated.get(i));
      Assert.assertTrue(file.createNewFile());
      filesCreated.add(file);
    }

    final MockReplayer replayer = new MockReplayer(basePath.toString(), Lists.reverse(filesCreated));
    replayer.readAll();

    Assert.assertEquals(replayer.getSeen(), expected);
  }
}
com.ning.billing.meter.timeline.persistentStreamyBytesPersistentOutputStreamgetFileName

Popular methods of StreamyBytesPersistentOutputStream

  • <init>
  • close
  • flushToFile
  • flushUnderlyingBufferAndReset
  • getBytesInMemory
  • getBytesOnDisk
  • getCreatedFiles
  • getInMemoryAvailableSpace
  • isEmpty
  • reset
  • write
  • write

Popular in Java

  • Updating database using SQL prepared statement
  • onRequestPermissionsResult (Fragment)
  • setRequestProperty (URLConnection)
  • compareTo (BigDecimal)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now