本文整理汇总了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());
}
}
示例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());
}
}
示例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);
}
示例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());
}
}
}
示例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);
}
示例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());
}
}
}
示例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);
}
示例8: SetData
import org.apache.hadoop.hbase.zookeeper.ZKUtil.ZKUtilOp.SetData; //导入依赖的package包/类
private SetData(String path, byte [] data) {
super(path);
this.data = data;
}