@Override public String getEntityName() { return getStream(); }
public String getTableName(StreamId streamId) { return String.format("stream_%s", cleanTableName(streamId.getStream())); }
private StreamViewId deserializeViewId(JsonObject id) { StreamId streamId = deserializeStreamId(id.getAsJsonObject("stream")); String view = id.get("id").getAsString(); return new StreamViewId(streamId.getNamespace(), streamId.getStream(), view); } }
private StreamViewId deserializeViewId(JsonObject id) { StreamId streamId = deserializeStreamId(id); String view = id.get("view").getAsString(); return new StreamViewId(streamId.getNamespace(), streamId.getStream(), view); }
/** * Disables ad-hoc exploration of the given stream. * * @param stream id of the stream. * @param tableName name of the Hive table to delete. */ public void disableExploreStream(StreamId stream, String tableName) throws ExploreException, SQLException { if (!exploreEnabled) { return; } ListenableFuture<Void> futureSuccess = exploreClient.disableExploreStream(stream, tableName); handleExploreFuture(futureSuccess, "disable", "stream", stream.getStream()); }
/** * Enables ad-hoc exploration of the given stream. * * @param stream id of the stream. * @param tableName name of the Hive table to create. * @param format format of the stream events. */ public void enableExploreStream(StreamId stream, String tableName, FormatSpecification format) throws ExploreException, SQLException { if (!exploreEnabled) { return; } ListenableFuture<Void> futureSuccess = exploreClient.enableExploreStream(stream, tableName, format); handleExploreFuture(futureSuccess, "enable", "stream", stream.getStream()); }
private void alterExploreStream(StreamId stream, boolean enable, @Nullable FormatSpecification format) { if (cConf.getBoolean(Constants.Explore.EXPLORE_ENABLED)) { // It shouldn't happen. Preconditions.checkNotNull(exploreFacade, "Explore enabled but no ExploreFacade instance is available"); try { if (enable) { exploreFacade.enableExploreStream(stream, tableNaming.getTableName(stream), format); LOG.info("Explore enabled on Stream '{}'.", stream.getStream()); } else { exploreFacade.disableExploreStream(stream, tableNaming.getTableName(stream)); } } catch (Exception e) { // at this time we want to still allow using stream even if it cannot be used for exploration String msg = String.format("Cannot alter exploration to %s for stream %s: %s", enable, stream, e.getMessage()); LOG.error(msg, e); } } }
public static Stream fromEntityId(StreamId streamId) { return from(Id.Namespace.fromEntityId(streamId.getNamespaceId()), streamId.getStream()); }
String streamName = streamId.getStream(); LOG.debug("Enabling explore for stream {} with table {}", streamId, tableName);
StreamId stream = (StreamId) namespacedEntityId; String namespaceId = stream.getNamespace(); String streamId = stream.getStream(); builder.add(namespaceId); builder.add(streamId);