Tabnine Logo
Sets.newHashSet
Code IndexAdd Tabnine to your IDE (free)

How to use
newHashSet
method
in
org.apache.drill.shaded.guava.com.google.common.collect.Sets

Best Java code snippets using org.apache.drill.shaded.guava.com.google.common.collect.Sets.newHashSet (Showing top 20 results out of 315)

origin: apache/drill

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);
 }
}
origin: apache/drill

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);
 }
}
origin: apache/drill

 @Override
 public Set<Entry<K, V>> entrySet() {
  return Sets.newHashSet(Iterables.transform(primary.entrySet(), new Function<Entry<K, Entry<Integer, V>>, Entry<K, V>>() {
   @Override
   public Entry<K, V> apply(Entry<K, Entry<Integer, V>> entry) {
    return new AbstractMap.SimpleImmutableEntry<>(entry.getKey(), entry.getValue().getValue());
   }
  }));
 }
};
origin: apache/drill

@Override
public Set<String> getTableNames() {
 if (tables == null) {
  try {
   tables = Sets.newHashSet(mClient.getTableNames(this.name, schemaConfig.getIgnoreAuthErrors()));
  } catch (final TException e) {
   logger.warn("Failure while attempting to access HiveDatabase '{}'.", this.name, e.getCause());
   tables = Sets.newHashSet(); // empty set.
  }
 }
 return tables;
}
origin: apache/drill

public GroupScan cloneWithNewSpec(List<KafkaPartitionScanSpec> partitionScanSpecList) {
 KafkaGroupScan clone = new KafkaGroupScan(this);
 HashSet<TopicPartition> partitionsInSpec = Sets.newHashSet();
 for(KafkaPartitionScanSpec scanSpec : partitionScanSpecList) {
  TopicPartition tp = new TopicPartition(scanSpec.getTopicName(), scanSpec.getPartitionId());
  partitionsInSpec.add(tp);
  PartitionScanWork newScanWork = new PartitionScanWork(partitionWorkMap.get(tp).getByteMap(), scanSpec);
  clone.partitionWorkMap.put(tp, newScanWork);
 }
 //Remove unnecessary partitions from partitionWorkMap
 clone.partitionWorkMap.keySet().removeIf(tp -> !partitionsInSpec.contains(tp));
 return clone;
}
origin: apache/drill

@Override
public Set<String> getTableNames() {
 try {
  ListTablesResponse tablesList = plugin.getClient().getTablesList();
  return Sets.newHashSet(tablesList.getTablesList());
 } catch (Exception e) {
  logger.warn("Failure reading kudu tables.", e);
  return Collections.emptySet();
 }
}
origin: apache/drill

@Override
public Set<String> getTableNames() {
 try(Admin admin = plugin.getConnection().getAdmin()) {
  HTableDescriptor[] tables = admin.listTables();
  Set<String> tableNames = Sets.newHashSet();
  for (HTableDescriptor table : tables) {
   tableNames.add(new String(table.getTableName().getNameAsString()));
  }
  return tableNames;
 } catch (Exception e) {
  logger.warn("Failure while loading table names for database '{}'.", getName(), e.getCause());
  return Collections.emptySet();
 }
}
origin: apache/drill

Set<TopicPartition> partitionsInNewSpec = Sets.newHashSet(); //Store topic-partitions returned from new spec.
origin: apache/drill

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();
}
origin: apache/drill

protected Collection<SchemaPath> transformColumns(Collection<SchemaPath> columns) {
 Set<SchemaPath> transformed = Sets.newLinkedHashSet();
 completeFamilies = Sets.newHashSet();
origin: apache/drill

@Override
public MajorType getMajorType() {
 if (outputType != null) {
  return outputType;
 }
 MajorType elseType = elseExpression.getMajorType();
 MajorType ifType = ifCondition.expression.getMajorType();
 if (elseType.getMinorType() == MinorType.UNION) {
  Set<MinorType> subtypes = Sets.newHashSet();
  for (MinorType subtype : elseType.getSubTypeList()) {
   subtypes.add(subtype);
  }
  for (MinorType subtype : ifType.getSubTypeList()) {
   subtypes.add(subtype);
  }
  MajorType.Builder builder = MajorType.newBuilder().setMinorType(MinorType.UNION).setMode(DataMode.OPTIONAL);
  for (MinorType subtype : subtypes) {
   builder.addSubType(subtype);
  }
  return builder.build();
 }
 MajorType.Builder builder = MajorType.newBuilder().setMinorType(ifType.getMinorType());
 builder.setMode(elseType.getMode() == DataMode.OPTIONAL || ifType.getMode() == DataMode.OPTIONAL ? DataMode.OPTIONAL : elseType.getMode());
 builder = Types.calculateTypePrecisionAndScale(ifType, elseType, builder);
 return builder.build();
}
origin: org.apache.drill.exec/drill-java-exec

@Override
public Set<SchemaPath> visitSchemaPath(SchemaPath path, Void value) {
 Set<SchemaPath> set = Sets.newHashSet();
 set.add(path);
 return set;
}
origin: org.apache.drill.exec/drill-java-exec

public PathInExpr(Map<LogicalExpression, Set<SchemaPath>> pathsInExpr) {
 this.pathsInExpr = pathsInExpr;
 allPaths = Sets.newHashSet();
 remainderPaths = Sets.newHashSet();
 remainderPathsInFunctions = Sets.newHashSet();
 for(Map.Entry<LogicalExpression, Set<SchemaPath>> entry: pathsInExpr.entrySet()) {
  allPaths.addAll(entry.getValue());
 }
}
origin: org.apache.drill.exec/drill-java-exec

@Override
public Set<SchemaPath> visitSchemaPath(SchemaPath path, Void value) {
 Set<SchemaPath> set = Sets.newHashSet();
 set.add(path);
 return set;
}
origin: org.apache.drill.contrib/drill-format-mapr

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);
 }
}
origin: org.apache.drill.contrib/drill-format-mapr

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);
 }
}
origin: org.apache.drill.exec/drill-java-exec

@Override
public Set<SchemaPath> visitUnknown(LogicalExpression e, Void value) {
 Set<SchemaPath> paths = Sets.newHashSet();
 for (LogicalExpression ex : e) {
  paths.addAll(ex.accept(this, null));
 }
 return paths;
}
origin: org.apache.drill.exec/drill-java-exec

 @Override
 public Set<SchemaPath> visitUnknown(LogicalExpression e, Void value) {
  Set<SchemaPath> paths = Sets.newHashSet();
  for (LogicalExpression ex : e) {
   paths.addAll(ex.accept(this, null));
  }
  return paths;
 }
}
origin: org.apache.drill/drill-common

 @Override
 public Set<Entry<K, V>> entrySet() {
  return Sets.newHashSet(Iterables.transform(primary.entrySet(), new Function<Entry<K, Entry<Integer, V>>, Entry<K, V>>() {
   @Override
   public Entry<K, V> apply(Entry<K, Entry<Integer, V>> entry) {
    return new AbstractMap.SimpleImmutableEntry<>(entry.getKey(), entry.getValue().getValue());
   }
  }));
 }
};
origin: org.apache.drill.exec/drill-java-exec

@Override
public long getActualSize() {
 Set<AllocationManager.BufferLedger> ledgers = Sets.newHashSet();
 startIndices.collectLedgers(ledgers);
 long size = 0L;
 for (AllocationManager.BufferLedger ledger: ledgers) {
  size += ledger.getAccountedSize();
 }
 for (BatchHolder batchHolder: batchHolders) {
  size += batchHolder.getActualSize();
 }
 return size;
}
org.apache.drill.shaded.guava.com.google.common.collectSetsnewHashSet

Javadoc

Creates a mutable, initially empty HashSet instance.

Note: if mutability is not required, use ImmutableSet#of() instead. If E is an Enum type, use EnumSet#noneOf instead. Otherwise, strongly consider using a LinkedHashSet instead, at the cost of increased memory footprint, to get deterministic iteration behavior.

Note for Java 7 and later: this method is now unnecessary and should be treated as deprecated. Instead, use the HashSet constructor directly, taking advantage of the new "diamond" syntax.

Popular methods of Sets

  • newLinkedHashSet
    Creates a mutable LinkedHashSet instance containing the given elements in order. Note: if mutability
  • newTreeSet
    Creates a mutable, empty TreeSet instance with the given comparator.Note: if mutability is not requi
  • union
    Returns an unmodifiable view of the union of two sets. The returned set contains all elements that a
  • filter
    Returns the elements of a SortedSet, unfiltered, that satisfy a predicate. The returned set is a liv
  • intersection
    Returns an unmodifiable view of the intersection of two sets. The returned set contains all elements
  • newHashSetWithExpectedSize
    Returns a new hash set using the smallest initial table size that can hold expectedSizeelements with
  • newIdentityHashSet
    Creates an empty Set that uses identity to determine equality. It compares object references, instea
  • cartesianProduct
    Returns every possible list that can be formed by choosing one element from each of the given sets i
  • difference
    Returns an unmodifiable view of the difference of two sets. The returned set contains all elements t
  • equalsImpl
    An implementation for Set#equals(Object).
  • hashCodeImpl
    An implementation for Set#hashCode().
  • immutableEnumSet
    Returns an immutable set instance containing the given enum elements. Internally, the returned set w
  • hashCodeImpl,
  • immutableEnumSet,
  • makeComplementByHand,
  • newConcurrentHashSet,
  • newLinkedHashSetWithExpectedSize,
  • removeAllImpl,
  • unmodifiableNavigableSet

Popular in Java

  • Reading from database using SQL prepared statement
  • onRequestPermissionsResult (Fragment)
  • notifyDataSetChanged (ArrayAdapter)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • DecimalFormat (java.text)
    A concrete subclass of NumberFormat that formats decimal numbers. It has a variety of features desig
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • Sublime Text for Python
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now