private void addTargetPathForOriginalPath(SchemaPath origPath, SchemaPath newPath) { if (!columnToConvert.containsKey(origPath)) { Set<SchemaPath> newSet = Sets.newHashSet(); newSet.add(newPath); columnToConvert.put(origPath, newSet); } else { columnToConvert.get(origPath).add(newPath); } }
public MapRDBFunctionalIndexInfo(IndexDescriptor indexDesc) { this.indexDesc = indexDesc; columnToConvert = Maps.newHashMap(); exprToConvert = Maps.newHashMap(); pathsInExpr = Maps.newHashMap(); // keep the order of new paths, it may be related to the naming policy newPathsForIndexedFunction = Sets.newLinkedHashSet(); allPathsInFunction = Sets.newHashSet(); init(); }
@Override protected Collection<SchemaPath> transformColumns(Collection<SchemaPath> columns) { Set<SchemaPath> transformed = Sets.newLinkedHashSet(); Set<SchemaPath> encodedSchemaPathSet = Sets.newLinkedHashSet(); Set<FieldPath> scannedFieldsSet = Sets.newTreeSet(); Set<FieldPath> projectedFieldsSet = null;
@Override protected Collection<SchemaPath> transformColumns(Collection<SchemaPath> projectedColumns) { Set<SchemaPath> transformed = Sets.newLinkedHashSet(); if (!isStarQuery()) { for (SchemaPath column : projectedColumns) { transformed.add(column); } } else { transformed.add(SchemaPath.STAR_COLUMN); } return transformed; }
/** * Checks if the proxy user is authorized to impersonate the target user based on the policies. * * @param proxyName proxy user name * @param targetName target user name * @param policies impersonation policies * @return true iff proxy user is authorized to impersonate the target user */ private static boolean hasImpersonationPrivileges(final String proxyName, final String targetName, final List<ImpersonationPolicy> policies) { final UserGroupInformation proxyUgi = ImpersonationUtil.createProxyUgi(proxyName); final Set<String> proxyGroups = Sets.newHashSet(proxyUgi.getGroupNames()); final UserGroupInformation targetUgi = ImpersonationUtil.createProxyUgi(targetName); final Set<String> targetGroups = Sets.newHashSet(targetUgi.getGroupNames()); for (final ImpersonationPolicy definition : policies) { // check if proxy user qualifies within this policy if (definition.proxy_principals.users.contains(proxyName) || !Sets.intersection(definition.proxy_principals.groups, proxyGroups).isEmpty()) { // check if target qualifies within this policy if (definition.target_principals.users.contains(targetName) || definition.target_principals.users.contains(STAR) || !Sets.intersection(definition.target_principals.groups, targetGroups).isEmpty() || definition.target_principals.groups.contains(STAR)) { return true; } } } return false; }
Set<RelNode> transformedRels = Sets.newIdentityHashSet(); Set<RelTraitSet> traitSets = Sets.newHashSet();
@Override Set<K> createKeySet() { return Sets.filter(unfiltered.keySet(), keyPredicate); }
@Override public void register(DrillOperatorTable operatorTable) { for (String name : Sets.union(methodsGenericUDF.asMap().keySet(), methodsUDF.asMap().keySet())) { operatorTable.addOperatorWithoutInference(name, new HiveUDFOperatorWithoutInference(name.toUpperCase())); operatorTable.addOperatorWithInference(name, new HiveUDFOperator(name.toUpperCase(), new HiveSqlReturnTypeInference())); } }
public Collection<DrillbitInfo> getDrillbits() { return Sets.newTreeSet(drillbits); }
@Override public Set<E> adjacentEdges(E edge) { EndpointPair<N> endpointPair = incidentNodes(edge); // Verifies that edge is in this network. Set<E> endpointPairIncidentEdges = Sets.union(incidentEdges(endpointPair.nodeU()), incidentEdges(endpointPair.nodeV())); return Sets.difference(endpointPairIncidentEdges, ImmutableSet.of(edge)); }
/** * {@inheritDoc} * * <p>Creates an empty {@code HashSet} for a collection of values for one key. * * @return a new {@code HashSet} containing a collection of values for one key */ @Override Set<V> createCollection() { return Sets.<V>newHashSetWithExpectedSize(expectedValuesPerKey); }
@Override Set<E> createElementSet() { return Sets.intersection(multiset1.elementSet(), multiset2.elementSet()); }
/** * Returns a sequence of field names in the order that they show up in the schema. */ protected Collection<String> getChildFieldNames() { return Sets.newLinkedHashSet(Iterables.transform(field.getChildren(), new Function<MaterializedField, String>() { @Nullable @Override public String apply(MaterializedField field) { return Preconditions.checkNotNull(field).getName(); } })); }
@Override protected Set<Entry<K, V>> createEntrySet() { return Sets.filter(unfiltered.entrySet(), predicate); }
@Override public UnmodifiableIterator<E> iterator() { Iterable<E> incidentEdges = (selfLoopCount == 0) ? Iterables.concat(inEdgeMap.keySet(), outEdgeMap.keySet()) : Sets.union(inEdgeMap.keySet(), outEdgeMap.keySet()); return Iterators.unmodifiableIterator(incidentEdges.iterator()); }
public Collection<String> getMismatchedVersions() { return Sets.newTreeSet(mismatchedVersions); }
@Override public Set<V> get() { return Sets.newHashSetWithExpectedSize(expectedValuesPerKey); } }
private void addPathInExpr(LogicalExpression expr, SchemaPath path) { if (!pathsInExpr.containsKey(expr)) { Set<SchemaPath> newSet = Sets.newHashSet(); newSet.add(path); pathsInExpr.put(expr, newSet); } else { pathsInExpr.get(expr).add(path); } }
Set<SchemaPath> transformed = Sets.newLinkedHashSet(); completeFamilies = Sets.newHashSet();
Set<Entry<TabletFragmentInfo, String>> regionsToAssignSet = Sets.newLinkedHashSet(regionsToScan.entrySet());