org.apache.curator.framework.api.PathAndBytesable Java Examples

The following examples show how to use org.apache.curator.framework.api.PathAndBytesable. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AbstractDataStore.java    From Baragon with Apache License 2.0 6 votes vote down vote up
protected <T> void writeToZk(String path, T data) {
  final long start = System.currentTimeMillis();

  try {
    final byte[] serializedInfo = serialize(data);

    final PathAndBytesable<?> builder;

    if (curatorFramework.checkExists().forPath(path) != null) {
      builder = curatorFramework.setData();
    } else {
      builder = curatorFramework.create().creatingParentsIfNeeded();
    }

    builder.forPath(path, serializedInfo);
    log(OperationType.WRITE, Optional.<Integer>absent(), Optional.of(serializedInfo.length), start, path);
  } catch (Exception e) {
    throw Throwables.propagate(e);
  }
}
 
Example #2
Source File: MockCurator.java    From vespa with Apache License 2.0 4 votes vote down vote up
public PathAndBytesable<T> inBackground() {
    throw new UnsupportedOperationException("Not implemented in MockCurator");
}
 
Example #3
Source File: MockCurator.java    From vespa with Apache License 2.0 4 votes vote down vote up
public PathAndBytesable<T> inBackground(Object o) {
    throw new UnsupportedOperationException("Not implemented in MockCurator");
}
 
Example #4
Source File: MockCurator.java    From vespa with Apache License 2.0 4 votes vote down vote up
public PathAndBytesable<T> inBackground(BackgroundCallback backgroundCallback) {
    throw new UnsupportedOperationException("Not implemented in MockCurator");
}
 
Example #5
Source File: MockCurator.java    From vespa with Apache License 2.0 4 votes vote down vote up
public PathAndBytesable<T> inBackground(BackgroundCallback backgroundCallback, Object o) {
    throw new UnsupportedOperationException("Not implemented in MockCurator");
}
 
Example #6
Source File: MockCurator.java    From vespa with Apache License 2.0 4 votes vote down vote up
public PathAndBytesable<T> inBackground(BackgroundCallback backgroundCallback, Executor executor) {
    throw new UnsupportedOperationException("Not implemented in MockCurator");
}
 
Example #7
Source File: MockCurator.java    From vespa with Apache License 2.0 4 votes vote down vote up
public PathAndBytesable<T> inBackground(BackgroundCallback backgroundCallback, Object o, Executor executor) {
    throw new UnsupportedOperationException("Not implemented in MockCurator");
}
 
Example #8
Source File: MockCurator.java    From vespa with Apache License 2.0 4 votes vote down vote up
@Override
public PathAndBytesable<CuratorTransactionBridge> withACL(List<ACL> list) {
    throw new UnsupportedOperationException("Not implemented in MockCurator");
}
 
Example #9
Source File: MockCurator.java    From vespa with Apache License 2.0 4 votes vote down vote up
@Override
public PathAndBytesable<CuratorTransactionBridge> compressed() {
    throw new UnsupportedOperationException("Not implemented in MockCurator");
}
 
Example #10
Source File: MockCurator.java    From vespa with Apache License 2.0 4 votes vote down vote up
@Override
public PathAndBytesable<CuratorTransactionBridge> withVersion(int i) {
    throw new UnsupportedOperationException("Not implemented in MockCurator");
}
 
Example #11
Source File: TransactionalStateZkStorage.java    From jstorm with Apache License 2.0 4 votes vote down vote up
protected String forPath(PathAndBytesable<String> builder,
                         String path, byte[] data) throws Exception {
    return (data == null)
            ? builder.forPath(path)
            : builder.forPath(path, data);
}
 
Example #12
Source File: TransactionalState.java    From jstorm with Apache License 2.0 4 votes vote down vote up
protected static String forPath(PathAndBytesable<String> builder, String path, byte[] data) throws Exception {
    return (data == null) ? builder.forPath(path) : builder.forPath(path, data);
}