org.apache.hadoop.hdfs.server.namenode.FSEditLogOp.DeleteOp Java Examples

The following examples show how to use org.apache.hadoop.hdfs.server.namenode.FSEditLogOp.DeleteOp. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TestNameNodeRecovery.java    From hadoop with Apache License 2.0 6 votes vote down vote up
@Override
public void addTransactionsToLog(EditLogOutputStream elos,
    OpInstanceCache cache) throws IOException {
  for (long txid = 1; txid <= MAX_TXID; txid++) {
    if (txid == BAD_TXID) {
      byte garbage[] = { 0x1, 0x2, 0x3 };
      elos.writeRaw(garbage, 0, garbage.length);
    }
    else {
      DeleteOp op;
      op = DeleteOp.getInstance(cache);
      op.setTransactionId(txid);
      op.setPath("/foo." + txid);
      op.setTimestamp(txid);
      elos.write(op);
    }
  }
}
 
Example #2
Source File: TestNameNodeRecovery.java    From big-c with Apache License 2.0 6 votes vote down vote up
@Override
public void addTransactionsToLog(EditLogOutputStream elos,
    OpInstanceCache cache) throws IOException {
  for (long txid = 1; txid <= MAX_TXID; txid++) {
    if (txid == BAD_TXID) {
      byte garbage[] = { 0x1, 0x2, 0x3 };
      elos.writeRaw(garbage, 0, garbage.length);
    }
    else {
      DeleteOp op;
      op = DeleteOp.getInstance(cache);
      op.setTransactionId(txid);
      op.setPath("/foo." + txid);
      op.setTimestamp(txid);
      elos.write(op);
    }
  }
}
 
Example #3
Source File: FSEditLog.java    From hadoop with Apache License 2.0 5 votes vote down vote up
/** 
 * Add delete file record to edit log
 */
void logDelete(String src, long timestamp, boolean toLogRpcIds) {
  DeleteOp op = DeleteOp.getInstance(cache.get())
    .setPath(src)
    .setTimestamp(timestamp);
  logRpcIds(op, toLogRpcIds);
  logEdit(op);
}
 
Example #4
Source File: TestNameNodeRecovery.java    From hadoop with Apache License 2.0 5 votes vote down vote up
static void addDeleteOpcode(EditLogOutputStream elos,
      OpInstanceCache cache, long txId, String path) throws IOException {
  DeleteOp op = DeleteOp.getInstance(cache);
  op.setTransactionId(txId);
  op.setPath(path);
  op.setTimestamp(0);
  elos.write(op);
}
 
Example #5
Source File: FSEditLog.java    From big-c with Apache License 2.0 5 votes vote down vote up
/** 
 * Add delete file record to edit log
 */
void logDelete(String src, long timestamp, boolean toLogRpcIds) {
  DeleteOp op = DeleteOp.getInstance(cache.get())
    .setPath(src)
    .setTimestamp(timestamp);
  logRpcIds(op, toLogRpcIds);
  logEdit(op);
}
 
Example #6
Source File: TestNameNodeRecovery.java    From big-c with Apache License 2.0 5 votes vote down vote up
static void addDeleteOpcode(EditLogOutputStream elos,
      OpInstanceCache cache, long txId, String path) throws IOException {
  DeleteOp op = DeleteOp.getInstance(cache);
  op.setTransactionId(txId);
  op.setPath(path);
  op.setTimestamp(0);
  elos.write(op);
}