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

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

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

origin: org.apache.hadoop/hadoop-hdfs

streams.close();
origin: ch.cern.hadoop/hadoop-hdfs

   anyBoolean(), any(DatanodeID[].class), any(String[].class));
} finally {
 streams.close();
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.fsdatasetReplicaOutputStreamsclose

Popular methods of ReplicaOutputStreams

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

Popular in Java

  • Running tasks concurrently on multiple threads
  • getSystemService (Context)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • runOnUiThread (Activity)
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • Option (scala)
  • From CI to AI: The AI layer in your organization
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