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


Java SetData类代码示例

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


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

示例1: toZooKeeperOp

import org.apache.hadoop.hbase.zookeeper.ZKUtil.ZKUtilOp.SetData; //导入依赖的package包/类
/**
 * Convert from ZKUtilOp to ZKOp
 */
private static Op toZooKeeperOp(ZooKeeperWatcher zkw, ZKUtilOp op)
throws UnsupportedOperationException {
  if(op == null) return null;

  if (op instanceof CreateAndFailSilent) {
    CreateAndFailSilent cafs = (CreateAndFailSilent)op;
    return Op.create(cafs.getPath(), cafs.getData(), createACL(zkw, cafs.getPath()),
      CreateMode.PERSISTENT);
  } else if (op instanceof DeleteNodeFailSilent) {
    DeleteNodeFailSilent dnfs = (DeleteNodeFailSilent)op;
    return Op.delete(dnfs.getPath(), -1);
  } else if (op instanceof SetData) {
    SetData sd = (SetData)op;
    return Op.setData(sd.getPath(), sd.getData(), -1);
  } else {
    throw new UnsupportedOperationException("Unexpected ZKUtilOp type: "
      + op.getClass().getName());
  }
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:23,代码来源:ZKUtil.java

示例2: toZooKeeperOp

import org.apache.hadoop.hbase.zookeeper.ZKUtil.ZKUtilOp.SetData; //导入依赖的package包/类
/**
 * Convert from ZKUtilOp to ZKOp
 */
private static Op toZooKeeperOp(ZKWatcher zkw, ZKUtilOp op) throws UnsupportedOperationException {
  if(op == null) {
    return null;
  }

  if (op instanceof CreateAndFailSilent) {
    CreateAndFailSilent cafs = (CreateAndFailSilent)op;
    return Op.create(cafs.getPath(), cafs.getData(), createACL(zkw, cafs.getPath()),
      CreateMode.PERSISTENT);
  } else if (op instanceof DeleteNodeFailSilent) {
    DeleteNodeFailSilent dnfs = (DeleteNodeFailSilent)op;
    return Op.delete(dnfs.getPath(), -1);
  } else if (op instanceof SetData) {
    SetData sd = (SetData)op;
    return Op.setData(sd.getPath(), sd.getData(), -1);
  } else {
    throw new UnsupportedOperationException("Unexpected ZKUtilOp type: "
      + op.getClass().getName());
  }
}
 
开发者ID:apache,项目名称:hbase,代码行数:24,代码来源:ZKUtil.java

示例3: equals

import org.apache.hadoop.hbase.zookeeper.ZKUtil.ZKUtilOp.SetData; //导入依赖的package包/类
@Override
public boolean equals(Object o) {
  if (this == o) return true;
  if (!(o instanceof SetData)) return false;

  SetData op = (SetData) o;
  return getPath().equals(op.getPath()) && Arrays.equals(data, op.data);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:9,代码来源:ZKUtil.java

示例4: processSequentially

import org.apache.hadoop.hbase.zookeeper.ZKUtil.ZKUtilOp.SetData; //导入依赖的package包/类
private static void processSequentially(ZooKeeperWatcher zkw, List<ZKUtilOp> ops)
    throws KeeperException, NoNodeException {
  for (ZKUtilOp op : ops) {
    if (op instanceof CreateAndFailSilent) {
      createAndFailSilent(zkw, (CreateAndFailSilent) op);
    } else if (op instanceof DeleteNodeFailSilent) {
      deleteNodeFailSilent(zkw, (DeleteNodeFailSilent) op);
    } else if (op instanceof SetData) {
      setData(zkw, (SetData) op);
    } else {
      throw new UnsupportedOperationException("Unexpected ZKUtilOp type: "
          + op.getClass().getName());
    }
  }
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:16,代码来源:ZKUtil.java

示例5: equals

import org.apache.hadoop.hbase.zookeeper.ZKUtil.ZKUtilOp.SetData; //导入依赖的package包/类
@Override
public boolean equals(Object o) {
  if (this == o) {
    return true;
  }
  if (!(o instanceof SetData)) {
    return false;
  }

  SetData op = (SetData) o;
  return getPath().equals(op.getPath()) && Arrays.equals(data, op.data);
}
 
开发者ID:apache,项目名称:hbase,代码行数:13,代码来源:ZKUtil.java

示例6: processSequentially

import org.apache.hadoop.hbase.zookeeper.ZKUtil.ZKUtilOp.SetData; //导入依赖的package包/类
private static void processSequentially(ZKWatcher zkw, List<ZKUtilOp> ops)
    throws KeeperException, NoNodeException {
  for (ZKUtilOp op : ops) {
    if (op instanceof CreateAndFailSilent) {
      createAndFailSilent(zkw, (CreateAndFailSilent) op);
    } else if (op instanceof DeleteNodeFailSilent) {
      deleteNodeFailSilent(zkw, (DeleteNodeFailSilent) op);
    } else if (op instanceof SetData) {
      setData(zkw, (SetData) op);
    } else {
      throw new UnsupportedOperationException("Unexpected ZKUtilOp type: "
          + op.getClass().getName());
    }
  }
}
 
开发者ID:apache,项目名称:hbase,代码行数:16,代码来源:ZKUtil.java

示例7: setData

import org.apache.hadoop.hbase.zookeeper.ZKUtil.ZKUtilOp.SetData; //导入依赖的package包/类
/**
 * @return a setData ZKUtilOp
 */
public static ZKUtilOp setData(String path, byte [] data) {
  return new SetData(path, data);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:7,代码来源:ZKUtil.java

示例8: SetData

import org.apache.hadoop.hbase.zookeeper.ZKUtil.ZKUtilOp.SetData; //导入依赖的package包/类
private SetData(String path, byte [] data) {
  super(path);
  this.data = data;
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:5,代码来源:ZKUtil.java


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