Tabnine Logo
SaveNamespaceContext.getTxId
Code IndexAdd Tabnine to your IDE (free)

How to use
getTxId
method
in
org.apache.hadoop.hdfs.server.namenode.SaveNamespaceContext

Best Java code snippets using org.apache.hadoop.hdfs.server.namenode.SaveNamespaceContext.getTxId (Showing top 10 results out of 315)

origin: org.apache.hadoop/hadoop-hdfs

/**
 * Save the contents of the FS image to the file.
 */
void saveFSImage(SaveNamespaceContext context, StorageDirectory sd,
  NameNodeFile dstType) throws IOException {
 long txid = context.getTxId();
 File newFile = NNStorage.getStorageFile(sd, NameNodeFile.IMAGE_NEW, txid);
 File dstFile = NNStorage.getStorageFile(sd, dstType, txid);
 
 FSImageFormatProtobuf.Saver saver = new FSImageFormatProtobuf.Saver(context);
 FSImageCompression compression = FSImageCompression.createCompression(conf);
 long numErrors = saver.save(newFile, compression);
 if (numErrors > 0) {
  // The image is likely corrupted.
  LOG.error("Detected " + numErrors + " errors while saving FsImage " +
    dstFile);
  exitAfterSave.set(true);
 }
 MD5FileUtils.saveMD5File(dstFile, saver.getSavedDigest());
 storage.setMostRecentCheckpointInfo(txid, Time.now());
}
origin: org.apache.hadoop/hadoop-hdfs

out.writeLong(blockIdManager.getGenerationStampAtblockIdSwitch());
out.writeLong(blockIdManager.getLastAllocatedContiguousBlockId());
out.writeLong(context.getTxId());
out.writeLong(sourceNamesystem.dir.getLastInodeId());
origin: org.apache.hadoop/hadoop-hdfs

private void saveNameSystemSection(FileSummary.Builder summary)
  throws IOException {
 final FSNamesystem fsn = context.getSourceNamesystem();
 OutputStream out = sectionOutputStream;
 BlockIdManager blockIdManager = fsn.getBlockManager().getBlockIdManager();
 NameSystemSection.Builder b = NameSystemSection.newBuilder()
   .setGenstampV1(blockIdManager.getLegacyGenerationStamp())
   .setGenstampV1Limit(blockIdManager.getLegacyGenerationStampLimit())
   .setGenstampV2(blockIdManager.getGenerationStamp())
   .setLastAllocatedBlockId(blockIdManager.getLastAllocatedContiguousBlockId())
   .setLastAllocatedStripedBlockId(blockIdManager.getLastAllocatedStripedBlockId())
   .setTransactionId(context.getTxId());
 // We use the non-locked version of getNamespaceInfo here since
 // the coordinating thread of saveNamespace already has read-locked
 // the namespace for us. If we attempt to take another readlock
 // from the actual saver thread, there's a potential of a
 // fairness-related deadlock. See the comments on HDFS-2223.
 b.setNamespaceId(fsn.unprotectedGetNamespaceInfo().getNamespaceID());
 if (fsn.isRollingUpgrade()) {
  b.setRollingUpgradeStartTime(fsn.getRollingUpgradeInfo().getStartTime());
 }
 NameSystemSection s = b.build();
 s.writeDelimitedTo(out);
 commitSection(summary, SectionName.NS_INFO);
}
origin: com.facebook.hadoop/hadoop-core

out.writeLong(fsDir.rootDir.numItemsInTree());
out.writeLong(sourceNamesystem.getGenerationStamp());
out.writeLong(context.getTxId());
origin: ch.cern.hadoop/hadoop-hdfs

out.writeLong(sourceNamesystem.getBlockIdManager().getGenerationStampAtblockIdSwitch());
out.writeLong(sourceNamesystem.getBlockIdManager().getLastAllocatedBlockId());
out.writeLong(context.getTxId());
out.writeLong(sourceNamesystem.dir.getLastInodeId());
origin: ch.cern.hadoop/hadoop-hdfs

/**
 * Save the contents of the FS image to the file.
 */
void saveFSImage(SaveNamespaceContext context, StorageDirectory sd,
  NameNodeFile dstType) throws IOException {
 long txid = context.getTxId();
 File newFile = NNStorage.getStorageFile(sd, NameNodeFile.IMAGE_NEW, txid);
 File dstFile = NNStorage.getStorageFile(sd, dstType, txid);
 
 FSImageFormatProtobuf.Saver saver = new FSImageFormatProtobuf.Saver(context);
 FSImageCompression compression = FSImageCompression.createCompression(conf);
 saver.save(newFile, compression);
 
 MD5FileUtils.saveMD5File(dstFile, saver.getSavedDigest());
 storage.setMostRecentCheckpointInfo(txid, Time.now());
}
origin: io.prestosql.hadoop/hadoop-apache

/**
 * Save the contents of the FS image to the file.
 */
void saveFSImage(SaveNamespaceContext context, StorageDirectory sd,
  NameNodeFile dstType) throws IOException {
 long txid = context.getTxId();
 File newFile = NNStorage.getStorageFile(sd, NameNodeFile.IMAGE_NEW, txid);
 File dstFile = NNStorage.getStorageFile(sd, dstType, txid);
 
 FSImageFormatProtobuf.Saver saver = new FSImageFormatProtobuf.Saver(context);
 FSImageCompression compression = FSImageCompression.createCompression(conf);
 saver.save(newFile, compression);
 
 MD5FileUtils.saveMD5File(dstFile, saver.getSavedDigest());
 storage.setMostRecentCheckpointInfo(txid, Time.now());
}
origin: io.prestosql.hadoop/hadoop-apache

out.writeLong(sourceNamesystem.getBlockIdManager().getGenerationStampAtblockIdSwitch());
out.writeLong(sourceNamesystem.getBlockIdManager().getLastAllocatedBlockId());
out.writeLong(context.getTxId());
out.writeLong(sourceNamesystem.dir.getLastInodeId());
origin: ch.cern.hadoop/hadoop-hdfs

private void saveNameSystemSection(FileSummary.Builder summary)
  throws IOException {
 final FSNamesystem fsn = context.getSourceNamesystem();
 OutputStream out = sectionOutputStream;
 BlockIdManager blockIdManager = fsn.getBlockIdManager();
 NameSystemSection.Builder b = NameSystemSection.newBuilder()
   .setGenstampV1(blockIdManager.getGenerationStampV1())
   .setGenstampV1Limit(blockIdManager.getGenerationStampV1Limit())
   .setGenstampV2(blockIdManager.getGenerationStampV2())
   .setLastAllocatedBlockId(blockIdManager.getLastAllocatedBlockId())
   .setTransactionId(context.getTxId());
 // We use the non-locked version of getNamespaceInfo here since
 // the coordinating thread of saveNamespace already has read-locked
 // the namespace for us. If we attempt to take another readlock
 // from the actual saver thread, there's a potential of a
 // fairness-related deadlock. See the comments on HDFS-2223.
 b.setNamespaceId(fsn.unprotectedGetNamespaceInfo().getNamespaceID());
 if (fsn.isRollingUpgrade()) {
  b.setRollingUpgradeStartTime(fsn.getRollingUpgradeInfo().getStartTime());
 }
 NameSystemSection s = b.build();
 s.writeDelimitedTo(out);
 commitSection(summary, SectionName.NS_INFO);
}
origin: io.prestosql.hadoop/hadoop-apache

private void saveNameSystemSection(FileSummary.Builder summary)
  throws IOException {
 final FSNamesystem fsn = context.getSourceNamesystem();
 OutputStream out = sectionOutputStream;
 BlockIdManager blockIdManager = fsn.getBlockIdManager();
 NameSystemSection.Builder b = NameSystemSection.newBuilder()
   .setGenstampV1(blockIdManager.getGenerationStampV1())
   .setGenstampV1Limit(blockIdManager.getGenerationStampV1Limit())
   .setGenstampV2(blockIdManager.getGenerationStampV2())
   .setLastAllocatedBlockId(blockIdManager.getLastAllocatedBlockId())
   .setTransactionId(context.getTxId());
 // We use the non-locked version of getNamespaceInfo here since
 // the coordinating thread of saveNamespace already has read-locked
 // the namespace for us. If we attempt to take another readlock
 // from the actual saver thread, there's a potential of a
 // fairness-related deadlock. See the comments on HDFS-2223.
 b.setNamespaceId(fsn.unprotectedGetNamespaceInfo().getNamespaceID());
 if (fsn.isRollingUpgrade()) {
  b.setRollingUpgradeStartTime(fsn.getRollingUpgradeInfo().getStartTime());
 }
 NameSystemSection s = b.build();
 s.writeDelimitedTo(out);
 commitSection(summary, SectionName.NS_INFO);
}
org.apache.hadoop.hdfs.server.namenodeSaveNamespaceContextgetTxId

Popular methods of SaveNamespaceContext

  • <init>
  • checkCancelled
  • getErrorSDs
  • getSourceNamesystem
  • reportErrorOnStorageDirectory
  • markComplete
  • cancel
    Requests that the current saveNamespace operation be canceled if it is still running.
  • clear
  • isCancelled
  • set

Popular in Java

  • Running tasks concurrently on multiple threads
  • getSharedPreferences (Context)
  • requestLocationUpdates (LocationManager)
  • addToBackStack (FragmentTransaction)
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • HashSet (java.util)
    HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • 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