当前位置: 首页>>代码示例>>Java>>正文


Java DeleteOp类代码示例

本文整理汇总了Java中org.apache.hadoop.hdfs.server.namenode.FSEditLogOp.DeleteOp的典型用法代码示例。如果您正苦于以下问题:Java DeleteOp类的具体用法?Java DeleteOp怎么用?Java DeleteOp使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


DeleteOp类属于org.apache.hadoop.hdfs.server.namenode.FSEditLogOp包,在下文中一共展示了DeleteOp类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addTransactionsToLog

import org.apache.hadoop.hdfs.server.namenode.FSEditLogOp.DeleteOp; //导入依赖的package包/类
@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);
    }
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:19,代码来源:TestNameNodeRecovery.java

示例2: createNotification

import org.apache.hadoop.hdfs.server.namenode.FSEditLogOp.DeleteOp; //导入依赖的package包/类
/**
 * Converts a Transaction Log operation into a NamespaceNotification
 * object.
 * @param op the Transaction Log operation.
 * @return the NamespaceNotification object or null if the type of
 *         the operation isn't supported to be transformed into a
 *         NamespaceNotification.
 */
static NamespaceNotification createNotification(FSEditLogOp op) {
  switch (op.opCode) {
    case OP_ADD:
      return new NamespaceNotification(((AddOp)op).path,
          EventType.FILE_ADDED.getByteValue(), op.getTransactionId());

    case OP_CLOSE:
      return new NamespaceNotification(((CloseOp)op).path,
          EventType.FILE_CLOSED.getByteValue(), op.getTransactionId());
      
    case OP_DELETE:
      return new NamespaceNotification(((DeleteOp)op).path,
          EventType.NODE_DELETED.getByteValue(), op.getTransactionId());
      
    case OP_MKDIR:
      return new NamespaceNotification(((MkdirOp)op).path,
          EventType.DIR_ADDED.getByteValue(), op.getTransactionId());
    default:
      return null;
  }
}
 
开发者ID:rhli,项目名称:hadoop-EAR,代码行数:30,代码来源:ServerLogReaderUtil.java

示例3: logDelete

import org.apache.hadoop.hdfs.server.namenode.FSEditLogOp.DeleteOp; //导入依赖的package包/类
/** 
 * 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);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:11,代码来源:FSEditLog.java

示例4: addDeleteOpcode

import org.apache.hadoop.hdfs.server.namenode.FSEditLogOp.DeleteOp; //导入依赖的package包/类
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);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:9,代码来源:TestNameNodeRecovery.java


注:本文中的org.apache.hadoop.hdfs.server.namenode.FSEditLogOp.DeleteOp类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。