Java 类org.apache.hadoop.hbase.regionserver.wal.HLog.Writer 实例源码

项目:LCIndex-HBase-0.94.16    文件:HLogSplitter.java   
private WriterAndPath createWAP(byte[] region, Entry entry, Path rootdir,
    FileSystem fs, Configuration conf)
throws IOException {
  Path regionedits = getRegionSplitEditsPath(fs, entry, rootdir, true);
  if (regionedits == null) {
    return null;
  }
  if (fs.exists(regionedits)) {
    LOG.warn("Found existing old edits file. It could be the "
        + "result of a previous failed split attempt. Deleting "
        + regionedits + ", length="
        + fs.getFileStatus(regionedits).getLen());
    if (!HBaseFileSystem.deleteFileFromFileSystem(fs, regionedits)) {
      LOG.warn("Failed delete of old " + regionedits);
    }
  }
  Writer w = createWriter(fs, regionedits, conf);
  LOG.debug("Creating writer path=" + regionedits + " region="
      + Bytes.toStringBinary(region));
  return (new WriterAndPath(regionedits, w));
}
项目:HIndex    文件:HLogSplitter.java   
private WriterAndPath createWAP(byte[] region, Entry entry, Path rootdir, FileSystem fs,
    Configuration conf) throws IOException {
  Path regionedits = getRegionSplitEditsPath(fs, entry, rootdir, true);
  if (regionedits == null) {
    return null;
  }
  if (fs.exists(regionedits)) {
    LOG.warn("Found old edits file. It could be the "
        + "result of a previous failed split attempt. Deleting " + regionedits + ", length="
        + fs.getFileStatus(regionedits).getLen());
    if (!fs.delete(regionedits, false)) {
      LOG.warn("Failed delete of old " + regionedits);
    }
  }
  Writer w = createWriter(fs, regionedits, conf);
  LOG.debug("Creating writer path=" + regionedits + " region=" + Bytes.toStringBinary(region));
  return (new WriterAndPath(regionedits, w));
}
项目:IRIndex    文件:HLogSplitter.java   
private WriterAndPath createWAP(byte[] region, Entry entry, Path rootdir,
    FileSystem fs, Configuration conf)
throws IOException {
  Path regionedits = getRegionSplitEditsPath(fs, entry, rootdir, true);
  if (regionedits == null) {
    return null;
  }
  if (fs.exists(regionedits)) {
    LOG.warn("Found existing old edits file. It could be the "
        + "result of a previous failed split attempt. Deleting "
        + regionedits + ", length="
        + fs.getFileStatus(regionedits).getLen());
    if (!HBaseFileSystem.deleteFileFromFileSystem(fs, regionedits)) {
      LOG.warn("Failed delete of old " + regionedits);
    }
  }
  Writer w = createWriter(fs, regionedits, conf);
  LOG.debug("Creating writer path=" + regionedits + " region="
      + Bytes.toStringBinary(region));
  return (new WriterAndPath(regionedits, w));
}
项目:PyroDB    文件:HLogSplitter.java   
private WriterAndPath createWAP(byte[] region, Entry entry, Path rootdir, FileSystem fs,
    Configuration conf) throws IOException {
  Path regionedits = getRegionSplitEditsPath(fs, entry, rootdir, true);
  if (regionedits == null) {
    return null;
  }
  if (fs.exists(regionedits)) {
    LOG.warn("Found old edits file. It could be the "
        + "result of a previous failed split attempt. Deleting " + regionedits + ", length="
        + fs.getFileStatus(regionedits).getLen());
    if (!fs.delete(regionedits, false)) {
      LOG.warn("Failed delete of old " + regionedits);
    }
  }
  Writer w = createWriter(fs, regionedits, conf);
  LOG.info("Creating writer path=" + regionedits + " region=" + Bytes.toStringBinary(region));
  return (new WriterAndPath(regionedits, w));
}
项目:c5    文件:HLogSplitter.java   
private WriterAndPath createWAP(byte[] region, Entry entry, Path rootdir, FileSystem fs,
    Configuration conf) throws IOException {
  Path regionedits = getRegionSplitEditsPath(fs, entry, rootdir, true);
  if (regionedits == null) {
    return null;
  }
  if (fs.exists(regionedits)) {
    LOG.warn("Found old edits file. It could be the "
        + "result of a previous failed split attempt. Deleting " + regionedits + ", length="
        + fs.getFileStatus(regionedits).getLen());
    if (!fs.delete(regionedits, false)) {
      LOG.warn("Failed delete of old " + regionedits);
    }
  }
  Writer w = createWriter(fs, regionedits, conf);
  LOG.debug("Creating writer path=" + regionedits + " region=" + Bytes.toStringBinary(region));
  return (new WriterAndPath(regionedits, w));
}
项目:HBase-Research    文件:HLogSplitter.java   
private WriterAndPath createWAP(byte[] region, Entry entry, Path rootdir,
    FileSystem fs, Configuration conf)
throws IOException {
  Path regionedits = getRegionSplitEditsPath(fs, entry, rootdir, true);
  if (regionedits == null) {
    return null;
  }
  if (fs.exists(regionedits)) {
    LOG.warn("Found existing old edits file. It could be the "
        + "result of a previous failed split attempt. Deleting "
        + regionedits + ", length="
        + fs.getFileStatus(regionedits).getLen());
    if (!HBaseFileSystem.deleteFileFromFileSystem(fs, regionedits)) {
      LOG.warn("Failed delete of old " + regionedits);
    }
  }
  Writer w = createWriter(fs, regionedits, conf);
  LOG.debug("Creating writer path=" + regionedits + " region="
      + Bytes.toStringBinary(region));
  return (new WriterAndPath(regionedits, w));
}
项目:hbase-0.94.8-qod    文件:HLogSplitter.java   
private WriterAndPath createWAP(byte[] region, Entry entry, Path rootdir,
    FileSystem fs, Configuration conf)
throws IOException {
  Path regionedits = getRegionSplitEditsPath(fs, entry, rootdir, true);
  if (regionedits == null) {
    return null;
  }
  if (fs.exists(regionedits)) {
    LOG.warn("Found existing old edits file. It could be the "
        + "result of a previous failed split attempt. Deleting "
        + regionedits + ", length="
        + fs.getFileStatus(regionedits).getLen());
    if (!HBaseFileSystem.deleteFileFromFileSystem(fs, regionedits)) {
      LOG.warn("Failed delete of old " + regionedits);
    }
  }
  Writer w = createWriter(fs, regionedits, conf);
  LOG.debug("Creating writer path=" + regionedits + " region="
      + Bytes.toStringBinary(region));
  return (new WriterAndPath(regionedits, w));
}
项目:hbase-0.94.8-qod    文件:HLogSplitter.java   
private WriterAndPath createWAP(byte[] region, Entry entry, Path rootdir,
    FileSystem fs, Configuration conf)
throws IOException {
  Path regionedits = getRegionSplitEditsPath(fs, entry, rootdir, true);
  if (regionedits == null) {
    return null;
  }
  if (fs.exists(regionedits)) {
    LOG.warn("Found existing old edits file. It could be the "
        + "result of a previous failed split attempt. Deleting "
        + regionedits + ", length="
        + fs.getFileStatus(regionedits).getLen());
    if (!HBaseFileSystem.deleteFileFromFileSystem(fs, regionedits)) {
      LOG.warn("Failed delete of old " + regionedits);
    }
  }
  Writer w = createWriter(fs, regionedits, conf);
  LOG.debug("Creating writer path=" + regionedits + " region="
      + Bytes.toStringBinary(region));
  return (new WriterAndPath(regionedits, w));
}
项目:DominoHBase    文件:HLogSplitter.java   
private WriterAndPath createWAP(byte[] region, Entry entry, Path rootdir,
    FileSystem fs, Configuration conf)
throws IOException {
  Path regionedits = getRegionSplitEditsPath(fs, entry, rootdir, true);
  if (regionedits == null) {
    return null;
  }
  if (fs.exists(regionedits)) {
    LOG.warn("Found existing old edits file. It could be the "
        + "result of a previous failed split attempt. Deleting "
        + regionedits + ", length="
        + fs.getFileStatus(regionedits).getLen());
    if (!fs.delete(regionedits, false)) {
      LOG.warn("Failed delete of old " + regionedits);
    }
  }
  Writer w = createWriter(fs, regionedits, conf);
  LOG.debug("Creating writer path=" + regionedits + " region="
      + Bytes.toStringBinary(region));
  return (new WriterAndPath(regionedits, w));
}
项目:DominoHBase    文件:HLogFactory.java   
/**
 * Create a writer for the WAL.
 * @return A WAL writer.  Close when done with it.
 * @throws IOException
 */
public static HLog.Writer createWriter(final FileSystem fs,
    final Path path, Configuration conf)
throws IOException {
  try {
    if (logWriterClass == null) {
      logWriterClass = conf.getClass("hbase.regionserver.hlog.writer.impl",
          SequenceFileLogWriter.class, Writer.class);
    }
    HLog.Writer writer = (HLog.Writer) logWriterClass.newInstance();
    writer.init(fs, path, conf);
    return writer;
  } catch (Exception e) {
    throw new IOException("cannot get log writer", e);
  }
}
项目:hindex    文件:HLogSplitter.java   
private WriterAndPath createWAP(byte[] region, Entry entry, Path rootdir,
    FileSystem fs, Configuration conf)
throws IOException {
  Path regionedits = getRegionSplitEditsPath(fs, entry, rootdir, true);
  if (regionedits == null) {
    return null;
  }
  if (fs.exists(regionedits)) {
    LOG.warn("Found existing old edits file. It could be the "
        + "result of a previous failed split attempt. Deleting "
        + regionedits + ", length="
        + fs.getFileStatus(regionedits).getLen());
    if (!HBaseFileSystem.deleteFileFromFileSystem(fs, regionedits)) {
      LOG.warn("Failed delete of old " + regionedits);
    }
  }
  Writer w = createWriter(fs, regionedits, conf);
  LOG.debug("Creating writer path=" + regionedits + " region="
      + Bytes.toStringBinary(region));
  return (new WriterAndPath(regionedits, w));
}
项目:LCIndex-HBase-0.94.16    文件:HLogFileSystem.java   
/**
 * Creates writer for the given path.
 * @param fs
 * @param conf
 * @param hlogFile
 * @return an init'ed writer for the given path.
 * @throws IOException
 */
public Writer createWriter(FileSystem fs, Configuration conf, Path hlogFile) throws IOException {
  int i = 0;
  IOException lastIOE = null;
  do {
    try {
      return HLog.createWriter(fs, hlogFile, conf);
    } catch (IOException ioe) {
      lastIOE = ioe;
      sleepBeforeRetry("Create Writer", i+1);
    }
  } while (++i <= hdfsClientRetriesNumber);
  throw new IOException("Exception in createWriter", lastIOE);

}
项目:HIndex    文件:HLogFactory.java   
private static HLog.Writer createWriter(final FileSystem fs,
    final Path path, Configuration conf, boolean overwritable)
throws IOException {
  try {
    if (logWriterClass == null) {
      logWriterClass = conf.getClass("hbase.regionserver.hlog.writer.impl",
          ProtobufLogWriter.class, Writer.class);
    }
    HLog.Writer writer = (HLog.Writer)logWriterClass.newInstance();
    writer.init(fs, path, conf, overwritable);
    return writer;
  } catch (Exception e) {
    throw new IOException("cannot get log writer", e);
  }
}
项目:IRIndex    文件:HLogFileSystem.java   
/**
 * Creates writer for the given path.
 * @param fs
 * @param conf
 * @param hlogFile
 * @return an init'ed writer for the given path.
 * @throws IOException
 */
public Writer createWriter(FileSystem fs, Configuration conf, Path hlogFile) throws IOException {
  int i = 0;
  IOException lastIOE = null;
  do {
    try {
      return HLog.createWriter(fs, hlogFile, conf);
    } catch (IOException ioe) {
      lastIOE = ioe;
      sleepBeforeRetry("Create Writer", i+1);
    }
  } while (++i <= hdfsClientRetriesNumber);
  throw new IOException("Exception in createWriter", lastIOE);

}
项目:RStore    文件:HLogSplitter.java   
private WriterAndPath createWAP(byte[] region, Entry entry,
    Path rootdir, String tmpname, FileSystem fs, Configuration conf)
throws IOException {
  Path regionedits = getRegionSplitEditsPath(fs, entry, rootdir,
      tmpname==null);
  if (regionedits == null) {
    return null;
  }
  if ((tmpname == null) && fs.exists(regionedits)) {
    LOG.warn("Found existing old edits file. It could be the "
        + "result of a previous failed split attempt. Deleting "
        + regionedits + ", length="
        + fs.getFileStatus(regionedits).getLen());
    if (!fs.delete(regionedits, false)) {
      LOG.warn("Failed delete of old " + regionedits);
    }
  }
  Path editsfile;
  if (tmpname != null) {
    // During distributed log splitting the output by each
    // SplitLogWorker is written to a temporary area.
    editsfile = convertRegionEditsToTemp(rootdir, regionedits, tmpname);
  } else {
    editsfile = regionedits;
  }
  Writer w = createWriter(fs, editsfile, conf);
  LOG.debug("Creating writer path=" + editsfile + " region="
      + Bytes.toStringBinary(region));
  return (new WriterAndPath(editsfile, w));
}
项目:PyroDB    文件:HLogFactory.java   
private static HLog.Writer createWriter(final FileSystem fs,
    final Path path, Configuration conf, boolean overwritable)
throws IOException {
  try {
    if (logWriterClass == null) {
      logWriterClass = conf.getClass("hbase.regionserver.hlog.writer.impl",
          ProtobufLogWriter.class, Writer.class);
    }
    HLog.Writer writer = (HLog.Writer)logWriterClass.newInstance();
    writer.init(fs, path, conf, overwritable);
    return writer;
  } catch (Exception e) {
    throw new IOException("cannot get log writer", e);
  }
}
项目:c5    文件:HLogFactory.java   
private static HLog.Writer createWriter(final FileSystem fs,
    final Path path, Configuration conf, boolean overwritable)
throws IOException {
  try {
    if (logWriterClass == null) {
      logWriterClass = conf.getClass("hbase.regionserver.hlog.writer.impl",
          ProtobufLogWriter.class, Writer.class);
    }
    HLog.Writer writer = (HLog.Writer)logWriterClass.newInstance();
    writer.init(fs, path, conf, overwritable);
    return writer;
  } catch (Exception e) {
    throw new IOException("cannot get log writer", e);
  }
}
项目:HBase-Research    文件:HLogFileSystem.java   
/**
 * Creates writer for the given path.
 * @param fs
 * @param conf
 * @param hlogFile
 * @return an init'ed writer for the given path.
 * @throws IOException
 */
public Writer createWriter(FileSystem fs, Configuration conf, Path hlogFile) throws IOException {
  int i = 0;
  IOException lastIOE = null;
  do {
    try {
      return HLog.createWriter(fs, hlogFile, conf);
    } catch (IOException ioe) {
      lastIOE = ioe;
      sleepBeforeRetry("Create Writer", i+1);
    }
  } while (++i <= hdfsClientRetriesNumber);
  throw new IOException("Exception in createWriter", lastIOE);

}
项目:hbase-0.94.8-qod    文件:HLogFileSystem.java   
/**
 * Creates writer for the given path.
 * @param fs
 * @param conf
 * @param hlogFile
 * @return an init'ed writer for the given path.
 * @throws IOException
 */
public Writer createWriter(FileSystem fs, Configuration conf, Path hlogFile) throws IOException {
  int i = 0;
  IOException lastIOE = null;
  do {
    try {
      return HLog.createWriter(fs, hlogFile, conf);
    } catch (IOException ioe) {
      lastIOE = ioe;
      sleepBeforeRetry("Create Writer", i+1);
    }
  } while (++i <= hdfsClientRetriesNumber);
  throw new IOException("Exception in createWriter", lastIOE);

}
项目:hbase-0.94.8-qod    文件:HLogFileSystem.java   
/**
 * Creates writer for the given path.
 * @param fs
 * @param conf
 * @param hlogFile
 * @return an init'ed writer for the given path.
 * @throws IOException
 */
public Writer createWriter(FileSystem fs, Configuration conf, Path hlogFile) throws IOException {
  int i = 0;
  IOException lastIOE = null;
  do {
    try {
      return HLog.createWriter(fs, hlogFile, conf);
    } catch (IOException ioe) {
      lastIOE = ioe;
      sleepBeforeRetry("Create Writer", i+1);
    }
  } while (++i <= hdfsClientRetriesNumber);
  throw new IOException("Exception in createWriter", lastIOE);

}
项目:hindex    文件:HLogFileSystem.java   
/**
 * Creates writer for the given path.
 * @param fs
 * @param conf
 * @param hlogFile
 * @return an init'ed writer for the given path.
 * @throws IOException
 */
public Writer createWriter(FileSystem fs, Configuration conf, Path hlogFile) throws IOException {
  int i = 0;
  IOException lastIOE = null;
  do {
    try {
      return HLog.createWriter(fs, hlogFile, conf);
    } catch (IOException ioe) {
      lastIOE = ioe;
      sleepBeforeRetry("Create Writer", i+1);
    }
  } while (++i <= hdfsClientRetriesNumber);
  throw new IOException("Exception in createWriter", lastIOE);

}
项目:hbase-secondary-index    文件:THLogSplitter.java   
private synchronized Writer getTrxWriter() throws IOException {
    if (trxWriter == null) {
        Path trxPath = new Path(logfile.getParent(), THLog.HREGION_OLD_THLOGFILE_NAME);
        trxWriter = THLog.createWriter(fs, trxPath, conf);
    }
    return trxWriter;
}
项目:LCIndex-HBase-0.94.16    文件:HLogSplitter.java   
/**
 * Create a new {@link Writer} for writing log splits.
 */
protected Writer createWriter(FileSystem fs, Path logfile, Configuration conf)
    throws IOException {
  return hlogFs.createWriter(fs, conf, logfile);
}
项目:LCIndex-HBase-0.94.16    文件:HLogSplitter.java   
WriterAndPath(final Path p, final Writer w) {
  this.p = p;
  this.w = w;
}
项目:HIndex    文件:HLogSplitter.java   
/**
 * Create a new {@link Writer} for writing log splits.
 */
protected Writer createWriter(FileSystem fs, Path logfile, Configuration conf)
    throws IOException {
  return HLogFactory.createRecoveredEditsWriter(fs, logfile, conf);
}
项目:HIndex    文件:HLogSplitter.java   
WriterAndPath(final Path p, final Writer w) {
  this.p = p;
  this.w = w;
}
项目:HIndex    文件:HLogFactory.java   
public static HLog.Writer createRecoveredEditsWriter(final FileSystem fs,
    final Path path, Configuration conf) throws IOException {
  return createWriter(fs, path, conf, true);
}
项目:IRIndex    文件:HLogSplitter.java   
/**
 * Create a new {@link Writer} for writing log splits.
 */
protected Writer createWriter(FileSystem fs, Path logfile, Configuration conf)
    throws IOException {
  return hlogFs.createWriter(fs, conf, logfile);
}
项目:IRIndex    文件:HLogSplitter.java   
WriterAndPath(final Path p, final Writer w) {
  this.p = p;
  this.w = w;
}
项目:RStore    文件:HLogSplitter.java   
/**
 * Create a new {@link Writer} for writing log splits.
 */
protected Writer createWriter(FileSystem fs, Path logfile, Configuration conf)
    throws IOException {
  return HLog.createWriter(fs, logfile, conf);
}
项目:RStore    文件:HLogSplitter.java   
WriterAndPath(final Path p, final Writer w) {
  this.p = p;
  this.w = w;
}
项目:PyroDB    文件:HLogSplitter.java   
/**
 * Create a new {@link Writer} for writing log splits.
 */
protected Writer createWriter(FileSystem fs, Path logfile, Configuration conf)
    throws IOException {
  return HLogFactory.createRecoveredEditsWriter(fs, logfile, conf);
}
项目:PyroDB    文件:HLogSplitter.java   
WriterAndPath(final Path p, final Writer w) {
  this.p = p;
  this.w = w;
}
项目:PyroDB    文件:HLogFactory.java   
public static HLog.Writer createRecoveredEditsWriter(final FileSystem fs,
    final Path path, Configuration conf) throws IOException {
  return createWriter(fs, path, conf, true);
}
项目:c5    文件:HLogSplitter.java   
/**
 * Create a new {@link Writer} for writing log splits.
 */
protected Writer createWriter(FileSystem fs, Path logfile, Configuration conf)
    throws IOException {
  return HLogFactory.createRecoveredEditsWriter(fs, logfile, conf);
}
项目:c5    文件:HLogSplitter.java   
WriterAndPath(final Path p, final Writer w) {
  this.p = p;
  this.w = w;
}
项目:c5    文件:HLogFactory.java   
public static HLog.Writer createRecoveredEditsWriter(final FileSystem fs,
    final Path path, Configuration conf) throws IOException {
  return createWriter(fs, path, conf, true);
}
项目:HBase-Research    文件:HLogSplitter.java   
/**
 * Create a new {@link Writer} for writing log splits.
 */
protected Writer createWriter(FileSystem fs, Path logfile, Configuration conf)
    throws IOException {
  return hlogFs.createWriter(fs, conf, logfile);
}
项目:HBase-Research    文件:HLogSplitter.java   
WriterAndPath(final Path p, final Writer w) {
  this.p = p;
  this.w = w;
}
项目:hbase-0.94.8-qod    文件:HLogSplitter.java   
/**
 * Create a new {@link Writer} for writing log splits.
 */
protected Writer createWriter(FileSystem fs, Path logfile, Configuration conf)
    throws IOException {
  return hlogFs.createWriter(fs, conf, logfile);
}