congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
FSEditLogLoader$PositionTrackingInputStream.getPos
Code IndexAdd Tabnine to your IDE (free)

How to use
getPos
method
in
org.apache.hadoop.hdfs.server.namenode.FSEditLogLoader$PositionTrackingInputStream

Best Java code snippets using org.apache.hadoop.hdfs.server.namenode.FSEditLogLoader$PositionTrackingInputStream.getPos (Showing top 14 results out of 315)

origin: org.apache.hadoop/hadoop-hdfs

/**
 * Process image file.
 */
public void go() throws IOException  {
 DataInputStream in = null;
 PositionTrackingInputStream tracker = null;
 ImageLoader fsip = null;
 boolean done = false;
 try {
  tracker = new PositionTrackingInputStream(new BufferedInputStream(
       new FileInputStream(new File(inputFile))));
  in = new DataInputStream(tracker);
  int imageVersionFile = findImageVersion(in);
  fsip = ImageLoader.LoaderFactory.getLoader(imageVersionFile);
  if(fsip == null) 
   throw new IOException("No image processor to read version " +
     imageVersionFile + " is available.");
  fsip.loadImage(in, processor, skipBlocks);
  done = true;
 } finally {
  if (!done) {
   if (tracker != null) {
    LOG.error("image loading failed at offset " + tracker.getPos());
   } else {
    LOG.error("Failed to load image file.");
   }
  }
  IOUtils.cleanupWithLogger(LOG, in, tracker);
 }
}
origin: org.apache.hadoop/hadoop-hdfs

long skipAmt = log.length() - tracker.getPos();
if (skipAmt > 0) {
 if (LOG.isDebugEnabled()) {
origin: ch.cern.hadoop/hadoop-hdfs

/**
 * Process image file.
 */
public void go() throws IOException  {
 DataInputStream in = null;
 PositionTrackingInputStream tracker = null;
 ImageLoader fsip = null;
 boolean done = false;
 try {
  tracker = new PositionTrackingInputStream(new BufferedInputStream(
       new FileInputStream(new File(inputFile))));
  in = new DataInputStream(tracker);
  int imageVersionFile = findImageVersion(in);
  fsip = ImageLoader.LoaderFactory.getLoader(imageVersionFile);
  if(fsip == null) 
   throw new IOException("No image processor to read version " +
     imageVersionFile + " is available.");
  fsip.loadImage(in, processor, skipBlocks);
  done = true;
 } finally {
  if (!done) {
   LOG.error("image loading failed at offset " + tracker.getPos());
  }
  IOUtils.cleanup(LOG, in, tracker);
 }
}
origin: ch.cern.hadoop/hadoop-hdfs

long skipAmt = log.length() - tracker.getPos();
if (skipAmt > 0) {
 if (LOG.isDebugEnabled()) {
origin: io.prestosql.hadoop/hadoop-apache

long skipAmt = log.length() - tracker.getPos();
if (skipAmt > 0) {
 if (LOG.isDebugEnabled()) {
origin: io.prestosql.hadoop/hadoop-apache

/**
 * Process image file.
 */
public void go() throws IOException  {
 DataInputStream in = null;
 PositionTrackingInputStream tracker = null;
 ImageLoader fsip = null;
 boolean done = false;
 try {
  tracker = new PositionTrackingInputStream(new BufferedInputStream(
       new FileInputStream(new File(inputFile))));
  in = new DataInputStream(tracker);
  int imageVersionFile = findImageVersion(in);
  fsip = ImageLoader.LoaderFactory.getLoader(imageVersionFile);
  if(fsip == null) 
   throw new IOException("No image processor to read version " +
     imageVersionFile + " is available.");
  fsip.loadImage(in, processor, skipBlocks);
  done = true;
 } finally {
  if (!done) {
   LOG.error("image loading failed at offset " + tracker.getPos());
  }
  IOUtils.cleanup(LOG, in, tracker);
 }
}
origin: ch.cern.hadoop/hadoop-hdfs

@Override
public long getPosition() {
 return tracker.getPos();
}
origin: ch.cern.hadoop/hadoop-hdfs

@Override
public long getPosition() {
 return tracker.getPos();
}
origin: com.facebook.hadoop/hadoop-core

@Override
public long getPosition() throws IOException{
 return tracker.getPos();
}

origin: io.prestosql.hadoop/hadoop-apache

@Override
public long getPosition() {
 return tracker.getPos();
}
origin: ch.cern.hadoop/hadoop-hdfs

@Override
public long getPosition() {
 if (state == State.OPEN) {
  return tracker.getPos();
 } else {
  return 0;
 }
}
origin: io.prestosql.hadoop/hadoop-apache

@Override
public long getPosition() {
 if (state == State.OPEN) {
  return tracker.getPos();
 } else {
  return 0;
 }
}
origin: org.apache.hadoop/hadoop-hdfs

@Override
public long getPosition() {
 if (state == State.OPEN) {
  return tracker.getPos();
 } else {
  return 0;
 }
}
origin: org.apache.hadoop/hadoop-hdfs

@Override
public long getPosition() {
 return tracker.getPos();
}
org.apache.hadoop.hdfs.server.namenodeFSEditLogLoader$PositionTrackingInputStreamgetPos

Popular methods of FSEditLogLoader$PositionTrackingInputStream

  • <init>
  • checkLimit
  • clearLimit
  • close
  • mark
  • read
  • reset
  • setLimit

Popular in Java

  • Making http requests using okhttp
  • getExternalFilesDir (Context)
  • putExtra (Intent)
  • onRequestPermissionsResult (Fragment)
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • MalformedURLException (java.net)
    This exception is thrown when a program attempts to create an URL from an incorrect specification.
  • Path (java.nio.file)
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • 21 Best IntelliJ Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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