@Override public String toString() { return StringUtils.format("serverTime-%s", windowPeriod); } };
@Override public String toString() { return StringUtils.format("bucket(%f, %f)", size, offset); } }
static String makeTaskId(String dataSource, int partitionNumber, DateTime timestamp, String suffix) { return StringUtils.format( "index_realtime_%s_%d_%s_%s", dataSource, partitionNumber, timestamp, suffix ); }
@Override protected String getQueryURL(String schemeAndHost) { return StringUtils.format("%s/druid/v2/sql", schemeAndHost); } }
public static File makeMetricFile(File dir, String metricName, ByteOrder order) { return new File(dir, StringUtils.format("met_%s_%s.drd", metricName, order)); } }
@Deprecated public String getSqlRemoveLogsOlderThan() { return StringUtils.format("DELETE a FROM %s a INNER JOIN %s b ON a.%s_id = b.id " + "WHERE b.created_date < :date_time and b.active = false", logTable, entryTable, entryTypeName ); }
@Nullable private Cache.NamedKey getCachePopulatorKey(String segmentId, Interval segmentInterval) { return cachePopulatorKeyMap.get(StringUtils.format("%s_%s", segmentId, segmentInterval)); }
@VisibleForTesting File getPersistFile(final String tier) { return new File(persistDirectory, StringUtils.format("%s.%s", tier, PERSIST_FILE_SUFFIX)); } }
@Override public String toString() { return StringUtils.format("Logger{name=[%s], class[%s]}", log.getName(), log.getClass()); }
@Override public String toString() { return StringUtils.format( "QueryInterruptedException{msg=%s, code=%s, class=%s, host=%s}", getMessage(), errorCode, errorClass, host ); }
@Override public String toString() { return StringUtils.format("substring(%s, %s)", index, getLength()); } }
/** * Make a Request object aimed at the leader. Throws IOException if the leader cannot be located. * * @param cached Uses cached leader if true, else uses the current leader */ public Request makeRequest(HttpMethod httpMethod, String urlPath, boolean cached) throws IOException { Preconditions.checkState(lifecycleLock.awaitStarted(1, TimeUnit.MILLISECONDS)); return new Request(httpMethod, new URL(StringUtils.format("%s%s", getCurrentKnownLeader(cached), urlPath))); }
private FullResponseHolder fetchLookupsForTier(String tier) throws InterruptedException, IOException { return druidLeaderClient.go( druidLeaderClient.makeRequest( HttpMethod.GET, StringUtils.format("/druid/coordinator/v1/lookups/config/%s?detailed=true", tier) ) ); }
@Override public void open() throws IOException { writer = CompressionFactory.getDoubleSerializer( segmentWriteOutMedium, StringUtils.format("%s.double_column", filenameBase), byteOrder, compression ); writer.open(); }
@Override public void open() throws IOException { writer = CompressionFactory.getFloatSerializer( segmentWriteOutMedium, StringUtils.format("%s.float_column", filenameBase), byteOrder, compression ); writer.open(); }
public Path makeSegmentPartitionInfoPath(Interval bucketInterval) { return new Path( StringUtils.format( "%s/%s_%s/partitions.json", makeIntermediatePath(), ISODateTimeFormat.basicDateTime().print(bucketInterval.getStart()), ISODateTimeFormat.basicDateTime().print(bucketInterval.getEnd()) ) ); }
@Deprecated @Override public String getSqlRemoveLogsOlderThan() { return StringUtils.format("DELETE FROM %s USING %s " + "WHERE %s_id = %s.id AND created_date < :date_time and active = false", getLogTable(), getEntryTable(), getEntryTypeName(), getEntryTable()); }
@Override public Boolean withHandle(Handle handle) { int rows = handle.createStatement( StringUtils.format("DELETE from %s WHERE dataSource = :dataSource", dbTables.getDataSourceTable()) ) .bind("dataSource", dataSource) .execute(); return rows > 0; } }
private boolean removeSegmentFromTable(String segmentId) { final int removed = connector.getDBI().withHandle( handle -> handle .createStatement(StringUtils.format("UPDATE %s SET used=false WHERE id = :segmentID", getSegmentsTable())) .bind("segmentID", segmentId) .execute() ); return removed > 0; }