@Test public void testGetCurrentDataDoNotUseCacheCompressed() throws Exception { testee = new ZkPathChildrenCacheWrapper(client, "/test", true, null); setupZookeeperClientReturnResult("/test", "result".getBytes(), true); byte[] result = testee.getCurrentData("/test"); Assert.assertEquals("result", new String(result)); }
@Override public byte[] getCurrentData(String fullPath) throws DataSourceConnectorException { byte[] result = null; if (isCacheUsageAllowed()) { ChildData childData = cache.getCurrentData(fullPath); if (childData != null) { result = childData.getData(); } } else { result = getBytesForPath(fullPath); } return result; }
ZkPathChildrenCacheWrapper extends BaseCacheWrapper implements IPathChildrenCacheWrapper { @Override public byte[] getCurrentData(String fullPath) throws DataSourceConnectorException { byte[] result = null; if (isCacheUsageAllowed()) { ChildData childData = cache.getCurrentData(fullPath); if (childData != null) { result = childData.getData(); } } else { result = getBytesForPath(fullPath); } return result; } }
ZkPathChildrenCacheWrapper extends BaseCacheWrapper implements IPathChildrenCacheWrapper { @Override public byte[] getCurrentData(String fullPath) throws DataSourceConnectorException { byte[] result = null; if (isCacheUsageAllowed()) { ChildData childData = cache.getCurrentData(fullPath); if (childData != null) { result = childData.getData(); } } else { result = getBytesForPath(fullPath); } return result; } ZkPathChildrenCacheWrapper(IDataSourceConnector connector,
                                      String path,
                                      boolean dataIsCompressed,
                                      PathChildrenCache cache); }
ZkPathChildrenCacheWrapper extends BaseCacheWrapper implements IPathChildrenCacheWrapper { @Override public byte[] getCurrentData(String fullPath) throws DataSourceConnectorException { byte[] result = null; if (isCacheUsageAllowed()) { ChildData childData = cache.getCurrentData(fullPath); if (childData != null) { result = childData.getData(); } } else { result = getBytesForPath(fullPath); } return result; } ZkPathChildrenCacheWrapper(IDataSourceConnector connector,
                                      String path,
                                      boolean dataIsCompressed,
                                      PathChildrenCache cache); @Override void start(final PathChildrenCache.StartMode startMode); @Override void addListener(PathChildrenCacheListener listener); @Override void rebuild(); @Override void close(); @Override void rebuildNode(final String path); @Override Map<String, byte[]> getNodeIdToDataMap(); @Override byte[] getCurrentData(String fullPath); boolean isUseCache(); }
ZkPathChildrenCacheWrapper extends BaseCacheWrapper implements IPathChildrenCacheWrapper { @Override public byte[] getCurrentData(String fullPath) throws DataSourceConnectorException { byte[] result = null; if (isCacheUsageAllowed()) { ChildData childData = cache.getCurrentData(fullPath); if (childData != null) { result = childData.getData(); } } else { result = getBytesForPath(fullPath); } return result; } ZkPathChildrenCacheWrapper(IDataSourceConnector connector,
                                      String path,
                                      boolean dataIsCompressed,
                                      PathChildrenCache cache); @Override void start(final PathChildrenCache.StartMode startMode); @Override void addListener(PathChildrenCacheListener listener); @Override void rebuild(); @Override void close(); @Override void rebuildNode(final String path); @Override Map<String, byte[]> getNodeIdToDataMap(); @Override byte[] getCurrentData(String fullPath); boolean isUseCache();  }