public static boolean isCompareFunction(String functionName) { return COMPARE_FUNCTIONS_TRANSPOSE_MAP.keySet().contains(functionName); }
public static boolean isPushdownFunction(String functionName) { return COMPARE_FUNCTIONS_TRANSPOSE_MAP.keySet().contains(functionName); }
public static boolean isCompareFunction(String functionName) { return COMPARE_FUNCTIONS_TRANSPOSE_MAP.keySet().contains(functionName); }
private List<KafkaPartitionScanSpec> createScanSpecForTimestamp(String functionName, Long fieldValue) { List<KafkaPartitionScanSpec> scanSpec = Lists.newArrayList(); Map<TopicPartition, Long> timesValMap = Maps.newHashMap(); ImmutableSet<TopicPartition> topicPartitions = fullScanSpec.keySet(); for(TopicPartition partitions : topicPartitions) { timesValMap.put(partitions, functionName.equals("greater_than") ? fieldValue+1 : fieldValue); } Map<TopicPartition, OffsetAndTimestamp> offsetAndTimestamp = kafkaConsumer.offsetsForTimes(timesValMap); for(TopicPartition tp : topicPartitions) { OffsetAndTimestamp value = offsetAndTimestamp.get(tp); //OffsetAndTimestamp is null if there is no offset greater or equal to requested timestamp if(value == null) { scanSpec.add( new KafkaPartitionScanSpec(tp.topic(), tp.partition(), fullScanSpec.get(tp).getEndOffset(), fullScanSpec.get(tp).getEndOffset())); } else { scanSpec.add( new KafkaPartitionScanSpec(tp.topic(), tp.partition(), value.offset(), fullScanSpec.get(tp).getEndOffset())); } } return scanSpec; }
private List<KafkaPartitionScanSpec> createScanSpecForOffset(String functionName, Long fieldValue) { List<KafkaPartitionScanSpec> scanSpec = Lists.newArrayList(); ImmutableSet<TopicPartition> topicPartitions = fullScanSpec.keySet();
private List<KafkaPartitionScanSpec> createScanSpecForPartition(String functionName, Long fieldValue) { List<KafkaPartitionScanSpec> scanSpecList = Lists.newArrayList(); ImmutableSet<TopicPartition> topicPartitions = fullScanSpec.keySet();
/** * Returns an immutable set of the valid column keys, including those that * are associated with null values only. * * @return immutable set of column keys */ @Override public ImmutableSet<C> columnKeySet() { return columnKeyToIndex.keySet(); }
/** * Returns an immutable set of the valid row keys, including those that are * associated with null values only. * * @return immutable set of row keys */ @Override public ImmutableSet<R> rowKeySet() { return rowKeyToIndex.keySet(); }
@Override public String toString() { return "Sets.combinations(" + index.keySet() + ", " + size + ")"; } };
/** * Returns an immutable set of the distinct keys in this multimap, in the same * order as they appear in this multimap. */ @Override public ImmutableSet<K> keySet() { return map.keySet(); }
@Override public String[] getMechanismNames(final Map<String, ?> props) { return serverFactories.keySet().toArray(new String[0]); } }
@Override public String[] getMechanismNames(final Map<String, ?> props) { return clientFactories.keySet().toArray(new String[0]); } }
@Override public ImmutableSet<R> rowKeySet() { return rowMap().keySet(); }
@Override public boolean contains(@Nullable Object obj) { if (obj instanceof Set) { Set<?> set = (Set<?>) obj; return inputSet.keySet().containsAll(set); } return false; }
@Override public boolean contains(@Nullable Object o) { if (o instanceof Set) { Set<?> s = (Set<?>) o; return s.size() == size && index.keySet().containsAll(s); } return false; }
public static boolean isCompareFunction(String functionName) { return COMPARE_FUNCTIONS_TRANSPOSE_MAP.keySet().contains(functionName); }
@Override public ImmutableSet<C> columnKeySet() { return columnMap().keySet(); }
@Override public int hashCode() { /* * The sum of the sums of the hash codes in each subset is just the sum of * each input element's hash code times the number of sets that element * appears in. Each element appears in exactly half of the 2^n sets, so: */ return inputSet.keySet().hashCode() << (inputSet.size() - 1); }
@Override public V put(K key, V value) { Integer index = keyIndex.get(key); if (index == null) { throw new IllegalArgumentException( getKeyRole() + " " + key + " not in " + keyIndex.keySet()); } return setValue(index, value); }
@Override ImmutableSet<K> createKeySet() { return isFull() ? keyToIndex().keySet() : super.createKeySet(); }