private String createAnnouncement(final String path, byte[] value) throws Exception { return curator.create().compressed().withMode(CreateMode.EPHEMERAL).inBackground().forPath(path, value); }
protected void announceSegmentForServer( DruidServer druidServer, DataSegment segment, ZkPathsConfig zkPathsConfig, ObjectMapper jsonMapper ) { final String segmentAnnouncementPath = ZKPaths.makePath(zkPathsConfig.getLiveSegmentsPath(), druidServer.getHost(), segment.getId().toString()); try { curator.create() .compressed() .withMode(CreateMode.EPHEMERAL) .forPath(segmentAnnouncementPath, jsonMapper.writeValueAsBytes(ImmutableSet.of(segment))); } catch (KeeperException.NodeExistsException e) { try { curator.setData() .forPath(segmentAnnouncementPath, jsonMapper.writeValueAsBytes(ImmutableSet.of(segment))); } catch (Exception e1) { Throwables.propagate(e1); } } catch (Exception e) { Throwables.propagate(e); } }
.compressed() .withMode(CreateMode.EPHEMERAL) .forPath(segmentAnnouncementPath, jsonMapper.writeValueAsBytes(segments));
@Override public CreateBackgroundModeACLable compressed() { return new CreateBackgroundModeACLableDecorator(inner.compressed()); }
public void set(String path, String data, boolean compress) { try { client.create().compressed().creatingParentsIfNeeded().forPath(path, data.getBytes()); } catch (Exception e) { // throw new RuntimeException(e); } }
private String createAnnouncement(final String path, byte[] value) throws Exception { return curator.create().compressed().withMode(CreateMode.EPHEMERAL).inBackground().forPath(path, value); }
private String createAnnouncement(final String path, byte[] value) throws Exception { return curator.create().compressed().withMode(CreateMode.EPHEMERAL).inBackground().forPath(path, value); }
private String createAnnouncement(final String path, byte[] value) throws Exception { return curator.create().compressed().withMode(CreateMode.EPHEMERAL).inBackground().forPath(path, value); }