public KafkaMessageSchema(final KafkaStoragePlugin plugin, final String name) { super(ImmutableList.<String> of(), name); this.plugin = plugin; }
public HivePartitionLocation(final List<String> partitionValues, final String partitionLocation) { this.partitionValues = ImmutableList.copyOf(partitionValues); this.partitionLocation = partitionLocation; } @Override
static <E> List<List<E>> create(List<? extends List<? extends E>> lists) { ImmutableList.Builder<List<E>> axesBuilder = new ImmutableList.Builder<List<E>>(lists.size()); for (List<? extends E> list : lists) { List<E> copy = ImmutableList.copyOf(list); if (copy.isEmpty()) { return ImmutableList.of(); } axesBuilder.add(copy); } return new CartesianList<E>(axesBuilder.build()); }
private void initCols(Schema schema) throws SchemaChangeException { ImmutableList.Builder<ProjectedColumnInfo> pciBuilder = ImmutableList.builder(); for (int i = 0; i < schema.getColumnCount(); i++) { ColumnDTO column = schema.getColumnByIndex(i); final String name = column.getColumnName(); final OpenTSDBTypes type = column.getColumnType(); TypeProtos.MinorType minorType = TYPES.get(type); if (isMinorTypeNull(minorType)) { String message = String.format( "A column you queried has a data type that is not currently supported by the OpenTSDB storage plugin. " + "The column's name was %s and its OpenTSDB data type was %s. ", name, type.toString()); throw UserException.unsupportedError() .message(message) .build(log); } ProjectedColumnInfo pci = getProjectedColumnInfo(column, name, minorType); pciBuilder.add(pci); } projectedCols = pciBuilder.build(); }
private static String likeString(FunctionCall call) { return ((QuotedString) call.args.get(1)).value; }
@Override public Iterator<LogicalExpression> iterator() { return args.iterator(); }
@Override public boolean equals(Object object) { if (object == this) { return true; } if (object instanceof CompoundOrdering) { CompoundOrdering<?> that = (CompoundOrdering<?>) object; return this.comparators.equals(that.comparators); } return false; }
@Override public Boolean visitFunctionCall(FunctionCall call, LogicalExpression valueArg) { Matcher matcher = convertFromPattern.matcher(call.getName()); if (matcher.find()) { // convert function call to ConvertExpression ConvertExpression convert = new ConvertExpression(ConvertExpression.CONVERT_FROM, matcher.group(1), call.args.get(0), call.getPosition()); return visitConvertExpression(convert, valueArg); } return false; }
/** * Returns the ancestor of the current domain at the given number of levels "higher" (rightward) * in the subdomain list. The number of levels must be non-negative, and less than {@code N-1}, * where {@code N} is the number of parts in the domain. * * <p>TODO: Reasonable candidate for addition to public API. */ private InternetDomainName ancestor(int levels) { return from(DOT_JOINER.join(parts.subList(levels, parts.size()))); }
/** * Returns a view of this immutable list in reverse order. For example, {@code * ImmutableList.of(1, 2, 3).reverse()} is equivalent to {@code * ImmutableList.of(3, 2, 1)}. * * @return a view of this immutable list in reverse order * @since 7.0 */ public ImmutableList<E> reverse() { return (size() <= 1) ? this : new ReverseImmutableList<E>(this); }
@Override public Iterator<LogicalExpression> iterator() { return args.iterator(); }