Tabnine Logo
ReplicaOutputStreams.getDataOut
Code IndexAdd Tabnine to your IDE (free)

How to use
getDataOut
method
in
org.apache.hadoop.hdfs.server.datanode.fsdataset.ReplicaOutputStreams

Best Java code snippets using org.apache.hadoop.hdfs.server.datanode.fsdataset.ReplicaOutputStreams.getDataOut (Showing top 7 results out of 315)

origin: org.apache.hadoop/hadoop-hdfs

if (streams.getDataOut() != null) {
 long flushStartNanos = System.nanoTime();
 streams.flushDataOut();
 dirSyncOnHSyncDone = true;
if (checksumOut != null || streams.getDataOut() != null) {
 datanode.metrics.addFlushNanos(flushTotalNanos);
 if (isSync) {
origin: org.apache.hadoop/hadoop-hdfs

if (syncOnClose && (streams.getDataOut() != null || checksumOut != null)) {
 datanode.metrics.incrFsyncCount();      
 if (streams.getDataOut() != null) {
  long flushStartNanos = System.nanoTime();
  streams.flushDataOut();
origin: org.apache.hadoop/hadoop-hdfs

IOUtils.closeStream(streams.getDataOut());
origin: ch.cern.hadoop/hadoop-hdfs

this.checksumSize = diskChecksum.getChecksumSize();
this.out = streams.getDataOut();
if (out instanceof FileOutputStream) {
 this.outFd = ((FileOutputStream)out).getFD();
origin: io.prestosql.hadoop/hadoop-apache

this.checksumSize = diskChecksum.getChecksumSize();
this.out = streams.getDataOut();
if (out instanceof FileOutputStream) {
 this.outFd = ((FileOutputStream)out).getFD();
origin: ch.cern.hadoop/hadoop-hdfs

ReplicaOutputStreams outputStreams =
  rbw.createStreams(false, DEFAULT_CHECKSUM);
OutputStream dataOutput = outputStreams.getDataOut();
origin: ch.cern.hadoop/hadoop-hdfs

int addSomeBlocks(SimulatedFSDataset fsdataset, int startingBlockId)
  throws IOException {
 int bytesAdded = 0;
 for (int i = startingBlockId; i < startingBlockId+NUMBLOCKS; ++i) {
  ExtendedBlock b = new ExtendedBlock(bpid, i, 0, 0); 
  // we pass expected len as zero, - fsdataset should use the sizeof actual
  // data written
  ReplicaInPipelineInterface bInfo = fsdataset.createRbw(
    StorageType.DEFAULT, b, false).getReplica();
  ReplicaOutputStreams out = bInfo.createStreams(true,
    DataChecksum.newDataChecksum(DataChecksum.Type.CRC32, 512));
  try {
   OutputStream dataOut  = out.getDataOut();
   assertEquals(0, fsdataset.getLength(b));
   for (int j=1; j <= blockIdToLen(i); ++j) {
    dataOut.write(j);
    assertEquals(j, bInfo.getBytesOnDisk()); // correct length even as we write
    bytesAdded++;
   }
  } finally {
   out.close();
  }
  b.setNumBytes(blockIdToLen(i));
  fsdataset.finalizeBlock(b, false);
  assertEquals(blockIdToLen(i), fsdataset.getLength(b));
 }
 return bytesAdded;  
}
int addSomeBlocks(SimulatedFSDataset fsdataset ) throws IOException {
org.apache.hadoop.hdfs.server.datanode.fsdatasetReplicaOutputStreamsgetDataOut

Popular methods of ReplicaOutputStreams

  • <init>
    Create an object with a data output stream, a checksum output stream and a checksum.
  • getChecksumOut
  • getChecksum
  • isTransientStorage
  • syncChecksumOut
    Sync the checksum stream if it supports it.
  • syncDataOut
    Sync the data stream if it supports it.
  • close
  • closeDataStream
  • dropCacheBehindWrites
  • flushDataOut
    Flush the data stream if it supports it.
  • getOutFd
  • syncFileRangeIfPossible
  • getOutFd,
  • syncFileRangeIfPossible,
  • writeDataToDisk

Popular in Java

  • Finding current android device location
  • getApplicationContext (Context)
  • getContentResolver (Context)
  • onCreateOptionsMenu (Activity)
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • JButton (javax.swing)
  • Best IntelliJ plugins
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