cascading.util.Util.createIdentitySet()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(5.5k)|赞(0)|评价(0)|浏览(112)

本文整理了Java中cascading.util.Util.createIdentitySet()方法的一些代码示例,展示了Util.createIdentitySet()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.createIdentitySet()方法的具体详情如下:
包路径:cascading.util.Util
类名称:Util
方法名:createIdentitySet

Util.createIdentitySet介绍

暂无

代码示例

代码示例来源:origin: cwensel/cascading

public Set<FlowElement> getRequiredElements()
 {
 if( requiredElements == null )
  requiredElements = createIdentitySet();
 return requiredElements;
 }

代码示例来源:origin: cwensel/cascading

public Set<FlowElement> getIgnoredElements()
 {
 if( ignoredElements == null )
  ignoredElements = createIdentitySet();
 return ignoredElements;
 }

代码示例来源:origin: cwensel/cascading

public Set<FlowElement> getExcludedElements()
 {
 if( excludedElements == null )
  excludedElements = createIdentitySet();
 return excludedElements;
 }

代码示例来源:origin: cwensel/cascading

public Set<FlowElement> getMatchedElements()
 {
 if( foundElements == null )
  foundElements = createIdentitySet();
 return foundElements;
 }

代码示例来源:origin: cwensel/cascading

@Override
protected Set<V> createCollection()
 {
 return Util.createIdentitySet();
 }
}

代码示例来源:origin: cwensel/cascading

public static <T> Set<T> differenceIdentity( Set<T> lhs, Set<T> rhs )
 {
 Set<T> diff = createIdentitySet( lhs );
 diff.removeAll( rhs );
 return diff;
 }

代码示例来源:origin: cwensel/cascading

public static <V> Set<V> createIdentitySet( Collection<V> collection )
 {
 Set<V> identitySet = createIdentitySet();
 if( collection != null )
  identitySet.addAll( collection );
 return identitySet;
 }

代码示例来源:origin: cwensel/cascading

public static Collection<Tap> unwind( Tap tap )
 {
 Set<Tap> taps = Util.createIdentitySet();
 addLeaves( tap, taps );
 return taps;
 }

代码示例来源:origin: cwensel/cascading

public ElementSubGraph( ElementGraph elementGraph, Collection<FlowElement> flowElements, Collection<Scope> scopes )
 {
 this.flowElements = createIdentitySet( flowElements );
 this.scopes = scopes == null || scopes.isEmpty() ? null : createIdentitySet( scopes ); // forces edges to be induced
 this.graph = new DirectedSubGraph( directed( elementGraph ), this.flowElements, this.scopes );
 this.elementGraph = elementGraph;
 }

代码示例来源:origin: cwensel/cascading

public static <T> Set<T> narrowIdentitySet( Class<T> type, Iterator iterator, boolean include )
 {
 return narrowSetInternal( type, iterator, include, Util.<T>createIdentitySet() );
 }

代码示例来源:origin: cwensel/cascading

@Override
public Set<ElementGraph> getIdentityElementGraphs()
 {
 Set<ElementGraph> results = createIdentitySet();
 for( Process process : getIdentityProcesses() )
  results.add( process.getElementGraph() );
 return results;
 }

代码示例来源:origin: cwensel/cascading

@Override
public Set<FlowElement> getAllSourceElements()
 {
 Set<FlowElement> results = createIdentitySet();
 for( Process process : vertexSet() )
  results.addAll( process.getSourceElements() );
 return results;
 }

代码示例来源:origin: cwensel/cascading

@Override
public Set<FlowElement> getAllSinkElements()
 {
 Set<FlowElement> results = createIdentitySet();
 for( Process process : vertexSet() )
  results.addAll( process.getSinkElements() );
 return results;
 }

代码示例来源:origin: cwensel/cascading

@Override
public Set<ElementGraph> getElementGraphs()
 {
 Set<ElementGraph> results = createIdentitySet();
 for( Process process : vertexSet() )
  results.add( process.getElementGraph() );
 return results;
 }

代码示例来源:origin: cwensel/cascading

public static Collection<FlowElement> getAllElementsBetweenInclusive( ElementGraph graph, FlowElement from, FlowElement to )
 {
 Set<FlowElement> results = Util.createIdentitySet();
 List<GraphPath<FlowElement, Scope>> pathsBetween = getAllShortestPathsBetween( graph, from, to );
 for( GraphPath<FlowElement, Scope> graphPath : pathsBetween )
  results.addAll( graphPath.getVertexList() );
 return results;
 }

代码示例来源:origin: cwensel/cascading

private void verifyPipelines()
 {
 if( pipelineGraphs == null || pipelineGraphs.isEmpty() )
  return;
 Set<FlowElement> allElements = createIdentitySet( nodeSubGraph.vertexSet() );
 for( ElementGraph pipelineGraph : pipelineGraphs )
  allElements.removeAll( pipelineGraph.vertexSet() );
 if( !allElements.isEmpty() )
  throw new IllegalStateException( "union of pipeline graphs for flow node are missing elements: " + Util.join( allElements, ", " ) );
 }

代码示例来源:origin: cwensel/cascading

public Set<FlowElement> getFlowElementsFor( Enum annotation )
 {
 Set<FlowElement> results = createIdentitySet();
 for( FlowNode flowNode : vertexSet() )
  results.addAll( flowNode.getFlowElementsFor( annotation ) );
 return results;
 }

代码示例来源:origin: cwensel/cascading

private static Set<FlowElement> getAllVertices( SubGraphIterator iterator )
 {
 Set<FlowElement> vertices = createIdentitySet();
 while( iterator.hasNext() )
  vertices.addAll( iterator.next().vertexSet() );
 return vertices;
 }

代码示例来源:origin: cwensel/cascading

@Override
public Set<? extends FlowElement> getFlowElementsFor( Enum annotation )
 {
 if( pipelineGraphs.isEmpty() )
  return ( (AnnotatedGraph) getElementGraph() ).getAnnotations().getValues( annotation );
 Set<FlowElement> results = createIdentitySet();
 for( ElementGraph pipelineGraph : pipelineGraphs )
  results.addAll( ( (AnnotatedGraph) pipelineGraph ).getAnnotations().getValues( annotation ) );
 return results;
 }

代码示例来源:origin: cwensel/cascading

@Override
public void onStarting( Flow flow )
 {
 Map<String, Tap> sources = flow.getSources();
 for( Map.Entry<String, Tap> entry : sources.entrySet() )
  {
  String key = entry.getKey();
  Tap value = entry.getValue();
  Set<Hfs> taps = Util.createIdentitySet();
  accumulate( taps, value );
  for( Hfs tap : taps )
   {
   if( !testExists( flow, tap ) )
    throw new FlowException( "cannot start flow: " + flow.getName() + ", _SUCCESS file missing in tap: '" + key + "', at: " + value.getIdentifier() );
   }
  }
 }

相关文章