You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@helix.apache.org by jx...@apache.org on 2018/03/25 21:44:57 UTC
[6/6] helix git commit: Add new API for getProperty and get
Add new API for getProperty and get
These new APIs will perform different behavior as before. It will throw an exception if throwException flag set to be true and at least one of path is failed to read in the list. Previous behavior is ignoring the read failure and filled with null for unread data.
Project: http://git-wip-us.apache.org/repos/asf/helix/repo
Commit: http://git-wip-us.apache.org/repos/asf/helix/commit/38b9a798
Tree: http://git-wip-us.apache.org/repos/asf/helix/tree/38b9a798
Diff: http://git-wip-us.apache.org/repos/asf/helix/diff/38b9a798
Branch: refs/heads/master
Commit: 38b9a7982da3a2f994da14571545dd40b696e5e7
Parents: 0e632b7
Author: Junkai Xue <jx...@linkedin.com>
Authored: Fri Mar 23 11:51:04 2018 -0700
Committer: dasahcc <ju...@gmail.com>
Committed: Sun Mar 25 14:43:42 2018 -0700
----------------------------------------------------------------------
.../java/org/apache/helix/BaseDataAccessor.java | 13 +++
.../org/apache/helix/HelixDataAccessor.java | 39 +++++++
.../helix/manager/zk/ZKHelixDataAccessor.java | 42 +++++--
.../helix/manager/zk/ZkBaseDataAccessor.java | 15 ++-
.../manager/zk/ZkCacheBaseDataAccessor.java | 11 +-
.../java/org/apache/helix/MockAccessor.java | 15 +++
.../manager/TestHelixDataAccessor.java | 51 ++++++++
.../apache/helix/mock/MockBaseDataAccessor.java | 6 +
.../org/apache/helix/mock/MockZkClient.java | 116 +++++++++++++++++++
9 files changed, 298 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/helix/blob/38b9a798/helix-core/src/main/java/org/apache/helix/BaseDataAccessor.java
----------------------------------------------------------------------
diff --git a/helix-core/src/main/java/org/apache/helix/BaseDataAccessor.java b/helix-core/src/main/java/org/apache/helix/BaseDataAccessor.java
index c42c700..7d024fa 100644
--- a/helix-core/src/main/java/org/apache/helix/BaseDataAccessor.java
+++ b/helix-core/src/main/java/org/apache/helix/BaseDataAccessor.java
@@ -141,6 +141,19 @@ public interface BaseDataAccessor<T> {
List<T> get(List<String> paths, List<Stat> stats, int options);
/**
+ * Get List of {@link T} corresponding to the paths using async api
+ * @param paths paths to the ZNodes
+ * @param stats retrieve a list of stats for the ZNodes
+ * @param options Set the type of ZNode see the valid values in {@link AccessOption}
+ * @param throwException Will throw an exception when it set to be true and one of the path
+ * is failed to read.
+ * @return List of record data stored at each ZNode, node value will return null if the node does
+ * not exist
+ */
+ List<T> get(List<String> paths, List<Stat> stats, int options, boolean throwException)
+ throws HelixException;
+
+ /**
* Get the children under a parent path using async api
*
* For this API, if some of child node is failed to read, Helix will return the data of read
http://git-wip-us.apache.org/repos/asf/helix/blob/38b9a798/helix-core/src/main/java/org/apache/helix/HelixDataAccessor.java
----------------------------------------------------------------------
diff --git a/helix-core/src/main/java/org/apache/helix/HelixDataAccessor.java b/helix-core/src/main/java/org/apache/helix/HelixDataAccessor.java
index f8ae131..d8dde1e 100644
--- a/helix-core/src/main/java/org/apache/helix/HelixDataAccessor.java
+++ b/helix-core/src/main/java/org/apache/helix/HelixDataAccessor.java
@@ -86,6 +86,19 @@ public interface HelixDataAccessor {
<T extends HelixProperty> List<T> getProperty(List<PropertyKey> keys);
/**
+ * Return a list of property values, each of which must be refer to a single Helix
+ * Property. Property may be bucketized.
+ *
+ * Value will be null if not does not exist. If the node is failed to read, will throw exception
+ * when throwException is set to true.
+ *
+ * @param keys
+ * @param throwException
+ * @return
+ */
+ <T extends HelixProperty> List<T> getProperty(List<PropertyKey> keys, boolean throwException);
+
+ /**
* Removes the property
* @param key
* @return true if removal was successful or node does not exist. false if the
@@ -124,6 +137,18 @@ public interface HelixDataAccessor {
<T extends HelixProperty> List<T> getChildValues(PropertyKey key);
/**
+ * Get the child values for a property. PropertyKey needs to refer to just one
+ * level above the non leaf. PropertyKey.isCollection must be true.
+ *
+ * Value will be null if not does not exist. If the node is failed to read, will throw exception
+ * when throwException is set to true.
+ * @param key
+ * @param throwException
+ * @return subPropertyValues
+ */
+ <T extends HelixProperty> List<T> getChildValues(PropertyKey key, boolean throwException);
+
+ /**
* Same as getChildValues except that it converts list into a map using the id
* of the HelixProperty
* @param key
@@ -133,6 +158,20 @@ public interface HelixDataAccessor {
<T extends HelixProperty> Map<String, T> getChildValuesMap(PropertyKey key);
/**
+ * Same as getChildValues except that it converts list into a map using the id
+ * of the HelixProperty
+ *
+ * Value will be null if not does not exist. If the node is failed to read, will throw exception
+ * when throwException is set to true.
+ * @param key
+ * @param throwException
+ * @return a map of property identifiers to typed properties
+ */
+
+ <T extends HelixProperty> Map<String, T> getChildValuesMap(PropertyKey key,
+ boolean throwException);
+
+ /**
* Adds multiple children to a parent.
* @param keys
* @param children
http://git-wip-us.apache.org/repos/asf/helix/blob/38b9a798/helix-core/src/main/java/org/apache/helix/manager/zk/ZKHelixDataAccessor.java
----------------------------------------------------------------------
diff --git a/helix-core/src/main/java/org/apache/helix/manager/zk/ZKHelixDataAccessor.java b/helix-core/src/main/java/org/apache/helix/manager/zk/ZKHelixDataAccessor.java
index eff76f8..a0c06f7 100644
--- a/helix-core/src/main/java/org/apache/helix/manager/zk/ZKHelixDataAccessor.java
+++ b/helix-core/src/main/java/org/apache/helix/manager/zk/ZKHelixDataAccessor.java
@@ -193,8 +193,15 @@ public class ZKHelixDataAccessor implements HelixDataAccessor {
return success;
}
+ @Deprecated
@Override
public <T extends HelixProperty> List<T> getProperty(List<PropertyKey> keys) {
+ return getProperty(keys, false);
+ }
+
+ @Override
+ public <T extends HelixProperty> List<T> getProperty(List<PropertyKey> keys,
+ boolean throwException) throws HelixException {
if (keys == null || keys.size() == 0) {
return Collections.emptyList();
}
@@ -208,7 +215,7 @@ public class ZKHelixDataAccessor implements HelixDataAccessor {
paths.add(key.getPath());
stats.add(new Stat());
}
- List<ZNRecord> children = _baseDataAccessor.get(paths, stats, 0);
+ List<ZNRecord> children = _baseDataAccessor.get(paths, stats, 0, throwException);
// check if bucketized
for (int i = 0; i < keys.size(); i++) {
@@ -240,7 +247,7 @@ public class ZKHelixDataAccessor implements HelixDataAccessor {
property.getRecord().getMapFields().clear();
property.getRecord().getListFields().clear();
- List<ZNRecord> childRecords = _baseDataAccessor.getChildren(path, null, options);
+ List<ZNRecord> childRecords = _baseDataAccessor.getChildren(path, null, options, 1, 0);
ZNRecord assembledRecord = new ZNRecordAssembler().assemble(childRecords);
// merge with parent node value
@@ -382,14 +389,24 @@ public class ZKHelixDataAccessor implements HelixDataAccessor {
return childNames;
}
+ @Deprecated
@Override
public <T extends HelixProperty> List<T> getChildValues(PropertyKey key) {
+ return getChildValues(key, false);
+ }
+
+ @Override
+ public <T extends HelixProperty> List<T> getChildValues(PropertyKey key, boolean throwException) {
PropertyType type = key.getType();
String parentPath = key.getPath();
int options = constructOptions(type);
List<T> childValues = new ArrayList<T>();
-
- List<ZNRecord> children = _baseDataAccessor.getChildren(parentPath, null, options);
+ List<ZNRecord> children;
+ if (throwException) {
+ children = _baseDataAccessor.getChildren(parentPath, null, options, 1, 0);
+ } else {
+ children = _baseDataAccessor.getChildren(parentPath, null, options);
+ }
if (children != null) {
for (ZNRecord record : children) {
switch (type) {
@@ -403,7 +420,12 @@ public class ZKHelixDataAccessor implements HelixDataAccessor {
if (bucketSize > 0) {
// TODO: fix this if record.id != pathName
String childPath = parentPath + "/" + record.getId();
- List<ZNRecord> childRecords = _baseDataAccessor.getChildren(childPath, null, options);
+ List<ZNRecord> childRecords;
+ if (throwException) {
+ childRecords = _baseDataAccessor.getChildren(childPath, null, options, 1, 0);
+ } else {
+ childRecords = _baseDataAccessor.getChildren(childPath, null, options);
+ }
ZNRecord assembledRecord = new ZNRecordAssembler().assemble(childRecords);
// merge with parent node value
@@ -430,18 +452,24 @@ public class ZKHelixDataAccessor implements HelixDataAccessor {
return childValues;
}
+ @Deprecated
@Override
public <T extends HelixProperty> Map<String, T> getChildValuesMap(PropertyKey key) {
+ return getChildValuesMap(key, false);
+ }
+
+ @Override
+ public <T extends HelixProperty> Map<String, T> getChildValuesMap(PropertyKey key,
+ boolean throwException) {
PropertyType type = key.getType();
String parentPath = key.getPath();
int options = constructOptions(type);
- List<T> children = getChildValues(key);
+ List<T> children = getChildValues(key, throwException);
Map<String, T> childValuesMap = new HashMap<String, T>();
for (T t : children) {
childValuesMap.put(t.getRecord().getId(), t);
}
return childValuesMap;
-
}
@Override
http://git-wip-us.apache.org/repos/asf/helix/blob/38b9a798/helix-core/src/main/java/org/apache/helix/manager/zk/ZkBaseDataAccessor.java
----------------------------------------------------------------------
diff --git a/helix-core/src/main/java/org/apache/helix/manager/zk/ZkBaseDataAccessor.java b/helix-core/src/main/java/org/apache/helix/manager/zk/ZkBaseDataAccessor.java
index 9525103..c83d9d5 100644
--- a/helix-core/src/main/java/org/apache/helix/manager/zk/ZkBaseDataAccessor.java
+++ b/helix-core/src/main/java/org/apache/helix/manager/zk/ZkBaseDataAccessor.java
@@ -336,10 +336,21 @@ public class ZkBaseDataAccessor<T> implements BaseDataAccessor<T> {
return get(paths, stats, needRead, false);
}
+
+ @Override
+ public List<T> get(List<String> paths, List<Stat> stats, int options,
+ boolean throwException) throws HelixException {
+ boolean[] needRead = new boolean[paths.size()];
+ Arrays.fill(needRead, true);
+
+ return get(paths, stats, needRead, throwException);
+ }
+
/**
* async get
*/
- List<T> get(List<String> paths, List<Stat> stats, boolean[] needRead, boolean throwException) {
+ List<T> get(List<String> paths, List<Stat> stats, boolean[] needRead, boolean throwException)
+ throws HelixException {
if (paths == null || paths.size() == 0) {
return Collections.emptyList();
}
@@ -398,6 +409,8 @@ public class ZkBaseDataAccessor<T> implements BaseDataAccessor<T> {
LOG.warn("Fail to read record for paths: " + pathFailToRead);
}
return records;
+ } catch (Exception e) {
+ throw new HelixException(String.format("Fail to read nodes for %s", paths));
} finally {
long endT = System.nanoTime();
if (LOG.isTraceEnabled()) {
http://git-wip-us.apache.org/repos/asf/helix/blob/38b9a798/helix-core/src/main/java/org/apache/helix/manager/zk/ZkCacheBaseDataAccessor.java
----------------------------------------------------------------------
diff --git a/helix-core/src/main/java/org/apache/helix/manager/zk/ZkCacheBaseDataAccessor.java b/helix-core/src/main/java/org/apache/helix/manager/zk/ZkCacheBaseDataAccessor.java
index 3a7553f..4c0fcf2 100644
--- a/helix-core/src/main/java/org/apache/helix/manager/zk/ZkCacheBaseDataAccessor.java
+++ b/helix-core/src/main/java/org/apache/helix/manager/zk/ZkCacheBaseDataAccessor.java
@@ -567,6 +567,12 @@ public class ZkCacheBaseDataAccessor<T> implements HelixPropertyStore<T> {
@Override
public List<T> get(List<String> paths, List<Stat> stats, int options) {
+ return get(paths, stats, options, false);
+ }
+
+ @Override
+ public List<T> get(List<String> paths, List<Stat> stats, int options, boolean throwException)
+ throws HelixException {
if (paths == null || paths.isEmpty()) {
return Collections.emptyList();
}
@@ -603,7 +609,8 @@ public class ZkCacheBaseDataAccessor<T> implements HelixPropertyStore<T> {
if (needRead) {
cache.lockWrite();
try {
- List<T> readRecords = _baseAccessor.get(serverPaths, readStats, needReads, false);
+ List<T> readRecords =
+ _baseAccessor.get(serverPaths, readStats, needReads, throwException);
for (int i = 0; i < size; i++) {
if (needReads[i]) {
records.set(i, readRecords.get(i));
@@ -624,7 +631,7 @@ public class ZkCacheBaseDataAccessor<T> implements HelixPropertyStore<T> {
}
// no cache
- return _baseAccessor.get(serverPaths, stats, options);
+ return _baseAccessor.get(serverPaths, stats, options, throwException);
}
// TODO: add cache
http://git-wip-us.apache.org/repos/asf/helix/blob/38b9a798/helix-core/src/test/java/org/apache/helix/MockAccessor.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/MockAccessor.java b/helix-core/src/test/java/org/apache/helix/MockAccessor.java
index 14c1845..e3189f8 100644
--- a/helix-core/src/test/java/org/apache/helix/MockAccessor.java
+++ b/helix-core/src/test/java/org/apache/helix/MockAccessor.java
@@ -190,12 +190,22 @@ public class MockAccessor implements HelixDataAccessor {
return (List<T>) HelixProperty.convertToTypedList(propertyKey.getTypeClass(), children);
}
+ @Override public <T extends HelixProperty> List<T> getChildValues(PropertyKey key,
+ boolean throwException) {
+ return null;
+ }
+
@Override
public <T extends HelixProperty> Map<String, T> getChildValuesMap(PropertyKey key) {
List<T> list = getChildValues(key);
return HelixProperty.convertListToMap(list);
}
+ @Override public <T extends HelixProperty> Map<String, T> getChildValuesMap(PropertyKey key,
+ boolean throwException) {
+ return null;
+ }
+
@Override
public <T extends HelixProperty> boolean[] createChildren(List<PropertyKey> keys,
List<T> children) {
@@ -239,4 +249,9 @@ public class MockAccessor implements HelixDataAccessor {
}
return list;
}
+
+ @Override public <T extends HelixProperty> List<T> getProperty(List<PropertyKey> keys,
+ boolean throwException) {
+ return null;
+ }
}
http://git-wip-us.apache.org/repos/asf/helix/blob/38b9a798/helix-core/src/test/java/org/apache/helix/integration/manager/TestHelixDataAccessor.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/integration/manager/TestHelixDataAccessor.java b/helix-core/src/test/java/org/apache/helix/integration/manager/TestHelixDataAccessor.java
new file mode 100644
index 0000000..ec0275a
--- /dev/null
+++ b/helix-core/src/test/java/org/apache/helix/integration/manager/TestHelixDataAccessor.java
@@ -0,0 +1,51 @@
+package org.apache.helix.integration.manager;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.TreeMap;
+import org.apache.helix.BaseDataAccessor;
+import org.apache.helix.HelixDataAccessor;
+import org.apache.helix.HelixException;
+import org.apache.helix.HelixProperty;
+import org.apache.helix.PropertyKey;
+import org.apache.helix.ZNRecord;
+import org.apache.helix.integration.common.ZkIntegrationTestBase;
+import org.apache.helix.manager.zk.ZKHelixDataAccessor;
+import org.apache.helix.manager.zk.ZkBaseDataAccessor;
+import org.apache.helix.mock.MockZkClient;
+import org.testng.Assert;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+public class TestHelixDataAccessor extends ZkIntegrationTestBase{
+ private MockZkClient _zkClient;
+
+ @BeforeClass
+ public void beforeClass() {
+ _zkClient = new MockZkClient(ZK_ADDR);
+ }
+
+ @Test(expectedExceptions = HelixException.class)
+ public void testHelixDataAccessorReadData() {
+ BaseDataAccessor<ZNRecord> baseDataAccessor = new ZkBaseDataAccessor<>(_zkClient);
+ HelixDataAccessor accessor = new ZKHelixDataAccessor("HELIX", baseDataAccessor);
+
+ Map<String, HelixProperty> paths = new TreeMap<>();
+ List<PropertyKey> propertyKeys = new ArrayList<>();
+ for (int i = 0; i < 5; i++) {
+ PropertyKey key = accessor.keyBuilder().idealStates("RESOURCE" + i);
+ propertyKeys.add(key);
+ paths.put(key.getPath(), new HelixProperty("RESOURCE" + i));
+ accessor.setProperty(key, paths.get(key.getPath()));
+ }
+
+ List<HelixProperty> data = accessor.getProperty(new ArrayList<>(propertyKeys));
+ Assert.assertEquals(data.size(), 5);
+
+ PropertyKey key = accessor.keyBuilder().idealStates("RESOURCE6");
+ propertyKeys.add(key);
+ _zkClient.putData(key.getPath(), null);
+ accessor.getProperty(new ArrayList<>(propertyKeys), true);
+ }
+}
http://git-wip-us.apache.org/repos/asf/helix/blob/38b9a798/helix-core/src/test/java/org/apache/helix/mock/MockBaseDataAccessor.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/mock/MockBaseDataAccessor.java b/helix-core/src/test/java/org/apache/helix/mock/MockBaseDataAccessor.java
index 099b3fc..55e0853 100644
--- a/helix-core/src/test/java/org/apache/helix/mock/MockBaseDataAccessor.java
+++ b/helix-core/src/test/java/org/apache/helix/mock/MockBaseDataAccessor.java
@@ -151,6 +151,12 @@ public class MockBaseDataAccessor implements BaseDataAccessor<ZNRecord> {
@Override
public List<ZNRecord> get(List<String> paths, List<Stat> stats, int options) {
+ return get(paths, stats, options, false);
+ }
+
+ @Override
+ public List<ZNRecord> get(List<String> paths, List<Stat> stats, int options,
+ boolean throwException) throws HelixException {
List<ZNRecord> records = new ArrayList<>();
for (int i = 0; i < paths.size(); i++) {
ZNRecord record = get(paths.get(i), stats.get(i), options);
http://git-wip-us.apache.org/repos/asf/helix/blob/38b9a798/helix-core/src/test/java/org/apache/helix/mock/MockZkClient.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/mock/MockZkClient.java b/helix-core/src/test/java/org/apache/helix/mock/MockZkClient.java
new file mode 100644
index 0000000..05d7894
--- /dev/null
+++ b/helix-core/src/test/java/org/apache/helix/mock/MockZkClient.java
@@ -0,0 +1,116 @@
+package org.apache.helix.mock;
+
+import java.util.HashMap;
+import java.util.Map;
+import org.I0Itec.zkclient.IZkConnection;
+import org.I0Itec.zkclient.serialize.ZkSerializer;
+import org.apache.helix.manager.zk.PathBasedZkSerializer;
+import org.apache.helix.manager.zk.ZNRecordSerializer;
+import org.apache.helix.manager.zk.ZkAsyncCallbacks;
+import org.apache.helix.manager.zk.ZkClient;
+import org.apache.zookeeper.KeeperException;
+
+public class MockZkClient extends ZkClient {
+ Map<String, byte[]> _dataMap;
+
+ public MockZkClient(String zkAddress) {
+ super(zkAddress);
+ _dataMap = new HashMap<>();
+ setZkSerializer(new ZNRecordSerializer());
+ }
+ public MockZkClient(IZkConnection zkConnection, int connectionTimeout, long operationRetryTimeout,
+ PathBasedZkSerializer zkSerializer, String monitorType, String monitorKey,
+ String monitorInstanceName, boolean monitorRootPathOnly) {
+ super(zkConnection, connectionTimeout, operationRetryTimeout, zkSerializer, monitorType,
+ monitorKey, monitorInstanceName, monitorRootPathOnly);
+ }
+
+ public MockZkClient(IZkConnection connection, int connectionTimeout,
+ PathBasedZkSerializer zkSerializer, String monitorType, String monitorKey,
+ long operationRetryTimeout) {
+ super(connection, connectionTimeout, zkSerializer, monitorType, monitorKey,
+ operationRetryTimeout);
+ }
+
+ public MockZkClient(IZkConnection connection, int connectionTimeout,
+ PathBasedZkSerializer zkSerializer, String monitorType, String monitorKey) {
+ super(connection, connectionTimeout, zkSerializer, monitorType, monitorKey);
+ }
+
+ public MockZkClient(String zkServers, String monitorType, String monitorKey) {
+ super(zkServers, monitorType, monitorKey);
+ }
+
+ public MockZkClient(String zkServers, int sessionTimeout, int connectionTimeout,
+ PathBasedZkSerializer zkSerializer, String monitorType, String monitorKey) {
+ super(zkServers, sessionTimeout, connectionTimeout, zkSerializer, monitorType, monitorKey);
+ }
+
+ public MockZkClient(IZkConnection connection, int connectionTimeout,
+ PathBasedZkSerializer zkSerializer) {
+ super(connection, connectionTimeout, zkSerializer);
+ }
+
+ public MockZkClient(IZkConnection connection, int connectionTimeout, ZkSerializer zkSerializer) {
+ super(connection, connectionTimeout, zkSerializer);
+ }
+
+ public MockZkClient(IZkConnection connection, int connectionTimeout) {
+ super(connection, connectionTimeout);
+ }
+
+ public MockZkClient(IZkConnection connection) {
+ super(connection);
+ }
+
+ public MockZkClient(String zkServers, int sessionTimeout, int connectionTimeout,
+ ZkSerializer zkSerializer) {
+ super(zkServers, sessionTimeout, connectionTimeout, zkSerializer);
+ }
+
+ public MockZkClient(String zkServers, int sessionTimeout, int connectionTimeout,
+ PathBasedZkSerializer zkSerializer) {
+ super(zkServers, sessionTimeout, connectionTimeout, zkSerializer);
+ }
+
+ public MockZkClient(String zkServers, int sessionTimeout, int connectionTimeout) {
+ super(zkServers, sessionTimeout, connectionTimeout);
+ }
+
+ public MockZkClient(String zkServers, int connectionTimeout) {
+ super(zkServers, connectionTimeout);
+ }
+
+ public MockZkClient(String zkServers, int sessionTimeout, int connectionTimeout,
+ ZkSerializer zkSerializer, long operationRetryTimeout) {
+ super(zkServers, sessionTimeout, connectionTimeout, zkSerializer, operationRetryTimeout);
+ }
+
+ public MockZkClient(IZkConnection zkConnection, int connectionTimeout, ZkSerializer zkSerializer,
+ long operationRetryTimeout) {
+ super(zkConnection, connectionTimeout, zkSerializer, operationRetryTimeout);
+ }
+
+
+ @Override
+ public void asyncGetData(final String path,
+ final ZkAsyncCallbacks.GetDataCallbackHandler cb) {
+ if (_dataMap.containsKey(path)) {
+ if (_dataMap.get(path) == null) {
+ cb.processResult(4, path, null, _dataMap.get(path), null);
+ } else {
+ cb.processResult(0, path, null, _dataMap.get(path), null);
+ }
+ } else {
+ cb.processResult(KeeperException.Code.NONODE.intValue(), path, null, null, null);
+ }
+ }
+
+ public void putData(String path, byte[] data) {
+ _dataMap.put(path, data);
+ }
+
+ public byte[] removeData(String path) {
+ return _dataMap.remove(path);
+ }
+}