@Override public void queryId(SearchQuery query) { throw new ISE("Unsupported method in default query metrics implementation."); }
@Override public void interval(SelectQuery query) { throw new ISE("Unsupported method in default query metrics implementation."); }
private void transition(final State from, final State to) { if (state != from) { throw new ISE("Cannot transition from[%s] to[%s].", from, to); } state = to; }
@Override public void queryType(SearchQuery query) { throw new ISE("Unsupported method in default query metrics implementation."); }
@Override public void interval(SearchQuery query) { throw new ISE("Unsupported method in default query metrics implementation."); }
@Override public void duration(SelectQuery query) { throw new ISE("Unsupported method in default query metrics implementation."); }
@Override public Emitter get() { if (emitter == null) { throw new ISE("Emitter was null, that's bad!"); } return emitter; } }
private void ensureFluentLimitsNotSet() { if (!(limit == Integer.MAX_VALUE && orderByColumnSpecs.isEmpty())) { throw new ISE("Ambiguous build, limit[%s] or columnSpecs[%s] already set.", limit, orderByColumnSpecs); } }
@Override public Queue accumulate(Queue accumulated, T in) { if (in == null) { throw new ISE("Cannot have null result"); } accumulated.offer(in); return accumulated; } };
public void announceSegment(final DataSegment segment) throws InterruptedException { if (finished) { throw new ISE("Announce segment called after finishAnnouncing"); } queue.put(segment); }
public static void registerSerde(String type, ComplexMetricSerde serde) { if (complexSerializers.containsKey(type)) { throw new ISE("Serializer for type[%s] already exists.", type); } complexSerializers.put(type, serde); } }
public static String getDefaultHost() { try { return InetAddress.getLocalHost().getCanonicalHostName(); } catch (UnknownHostException e) { throw new ISE(e, "Unable to determine host name"); } }
@Override public void registerServerRemovedCallback(Executor exec, ServerRemovedCallback callback) { if (lifecycleLock.isStarted()) { throw new ISE("Lifecycle has already started."); } serverCallbacks.put(callback, exec); }
@Override public ShardSpec getShardSpec(long timestamp, InputRow row) { for (ShardSpec spec : shardSpecs) { if (spec.isInChunk(timestamp, row)) { return spec; } } throw new ISE("row[%s] doesn't fit in any shard[%s]", row, shardSpecs); } };
@Override public int getRowCount(final SegmentIdentifier identifier) { final Sink sink = sinks.get(identifier); if (sink == null) { throw new ISE("No such sink: %s", identifier); } else { return sink.getNumRows(); } }
public SingleLongInputCachingExpressionColumnValueSelector( final ColumnValueSelector selector, final Expr expression ) { // Verify expression has just one binding. if (Parser.findRequiredBindings(expression).size() != 1) { throw new ISE("WTF?! Expected expression with just one binding"); } this.selector = Preconditions.checkNotNull(selector, "selector"); this.expression = Preconditions.checkNotNull(expression, "expression"); }
public File getInfoDir() { if (infoDir == null) { if (locations == null || locations.size() == 0) { throw new ISE("You have no segment cache locations defined. Please configure druid.segmentCache.locations to use one or more locations."); } infoDir = new File(locations.get(0).getPath(), "info_dir"); } return infoDir; }
static void checkLockCoversSegments( final Task task, final TaskLockbox taskLockbox, final Collection<DataSegment> segments ) { if (!isLockCoversSegments(task, taskLockbox, segments)) { throw new ISE("Segments not covered by locks for task: %s", task.getId()); } }
@Override public Sequence<Row> run(QueryPlus<Row> queryPlus, Map<String, Object> responseContext) { Query<Row> query = queryPlus.getQuery(); if (!(query instanceof GroupByQuery)) { throw new ISE("Got a [%s] which isn't a %s", query.getClass(), GroupByQuery.class); } return strategySelector.strategize((GroupByQuery) query).process((GroupByQuery) query, adapter); } }
public Server pickDefaultServer() { Server server = findDefaultServer(); if (server == null) { log.makeAlert( "Catastrophic failure! No servers found at all! Failing request!" ).emit(); throw new ISE("No default server found!"); } return server; }