Tabnine Logo
Pair.first
Code IndexAdd Tabnine to your IDE (free)

How to use
first
method
in
org.apache.crunch.Pair

Best Java code snippets using org.apache.crunch.Pair.first (Showing top 20 results out of 315)

Refine searchRefine arrow

  • Pair.second
origin: org.apache.crunch/crunch-core

 @Override
 public Double map(Pair<Double, Long> input) {
  return input.first() / input.second();
 }
}, ptf.doubles());
origin: spotify/crunch-lib

 @Override
 public Double map(Pair<Double, Long> input) {
  return input.first() / input.second();
 }
}, ptf.doubles());
origin: org.apache.crunch/crunch

 /**
  * Split up the input record to make coding a bit more manageable.
  * 
  * @param input The input record.
  * @param emitter The emitter to send the output to.
  */
 @Override
 public void process(Pair<Pair<K, Integer>, Iterable<Pair<U, V>>> input,
   Emitter<Pair<K, Pair<U, V>>> emitter) {
  join(input.first().first(), input.first().second(), input.second(), emitter);
 }
}
origin: org.apache.crunch/crunch

public InMemoryJoinFn(Iterable<Pair<K, V>> iterable) {
 joinMap = HashMultimap.create();
 for (Pair<K, V> joinPair : iterable) {
  joinMap.put(joinPair.first(), joinPair.second());
 }
}

origin: apache/crunch

 @Override
 public Tuple2<K, V> apply(@Nullable Pair<K, V> kv) {
  return kv == null ? null : new Tuple2<K, V>(kv.first(), kv.second());
 }
};
origin: org.apache.crunch/crunch-core

private Map<K, V> delegate() {
 if (delegate == null) {
  delegate = new HashMap<K, V>();
  for (Pair<K, V> x : iterable) {
   delegate.put(x.first(), x.second());
  }
 }
 return delegate;
}
origin: org.apache.crunch/crunch-core

 @Override
 public void add(Pair<Pair<K, SK>, V> record) {
  K primary = record.first().first();
  if (!map.containsKey(primary)) {
   map.put(primary, Lists.<Pair<SK, V>>newArrayList());
  }
  map.get(primary).add(Pair.of(record.first().second(), record.second()));
 }
}
origin: cloudera/crunch

 @Override
 public void process(Pair<T, Pair<Collection<Boolean>, Collection<Boolean>>> input,
   Emitter<T> emitter) {
  Pair<Collection<Boolean>, Collection<Boolean>> groups = input.second();
  if (!groups.first().isEmpty() && !groups.second().isEmpty()) {
   emitter.emit(input.first());
  }
 }
}, coll1.getPType());
origin: org.apache.crunch/crunch

 @Override
 public void process(Pair<T, Pair<Collection<Boolean>, Collection<Boolean>>> input, Emitter<T> emitter) {
  Pair<Collection<Boolean>, Collection<Boolean>> groups = input.second();
  if (!groups.first().isEmpty() && groups.second().isEmpty()) {
   emitter.emit(input.first());
  }
 }
}, coll1.getPType());
origin: org.apache.crunch/crunch-core

 @Override
 public Pair<V2, V1> map(Pair<V1, V2> input) {
  if (input == null) {
   return null;
  }
  return Pair.of(input.second(), input.first());
 }
}
origin: org.apache.crunch/crunch-core

 @Override
 public Pair<Integer, T> map(Pair<Integer, Pair<Double, T>> p) {
  return Pair.of(p.first(), p.second().second());
 }
}, ptf.pairs(ptf.ints(), ttype));
origin: org.apache.crunch/crunch-core

 @Override
 public Pair<K, Long> map(Pair<K, Long> input) {
  return Pair.of(input.first(), -input.second());
 }
}, table.getPTableType());
origin: org.apache.crunch/crunch-core

 @Override
 public Pair<Pair<K, V1>, Pair<V1, V2>> map(Pair<K, Pair<V1, V2>> input) {
  return Pair.of(Pair.of(input.first(), input.second().first()), input.second());
 }
}  
origin: org.apache.crunch/crunch

 @Override
 public void process(Pair<T, Pair<Collection<Boolean>, Collection<Boolean>>> input,
   Emitter<Tuple3<T, T, T>> emitter) {
  Pair<Collection<Boolean>, Collection<Boolean>> groups = input.second();
  boolean inFirst = !groups.first().isEmpty();
  boolean inSecond = !groups.second().isEmpty();
  T t = input.first();
  emitter.emit(Tuple3.of(inFirst && !inSecond ? t : null, !inFirst && inSecond ? t : null, inFirst
    && inSecond ? t : null));
 }
}, typeFamily.triples(type, type, type));
origin: spotify/crunch-lib

 @Override
 public Result<V> map(Pair<Collection<Pair<Double, V>>, Long> input) {
  return new Result<V>(input.second(), input.first());
 }
}, new MapFn<Result<V>, Pair<Collection<Pair<Double, V>>, Long>>() {
origin: cloudera/crunch

 @Override
 public void process(Pair<T, Pair<Collection<Boolean>, Collection<Boolean>>> input,
   Emitter<Tuple3<T, T, T>> emitter) {
  Pair<Collection<Boolean>, Collection<Boolean>> groups = input.second();
  boolean inFirst = !groups.first().isEmpty();
  boolean inSecond = !groups.second().isEmpty();
  T t = input.first();
  emitter.emit(Tuple3.of(
    inFirst && !inSecond ? t : null,
      !inFirst && inSecond ? t : null,
        inFirst && inSecond ? t : null));
 }
}, typeFamily.triples(type, type, type));
origin: cloudera/crunch

 @Override
 public void process(
   Pair<Pair<Integer, Integer>, Pair<Collection<Pair<K1, U>>, Collection<Pair<K2, V>>>> input,
   Emitter<Pair<Pair<K1, K2>, Pair<U, V>>> emitter) {
  for (Pair<K1, U> l: input.second().first()) {
   for (Pair<K2, V> r: input.second().second()) {
    emitter.emit(Pair.of(Pair.of(l.first(), r.first()), Pair.of(l.second(), r.second())));
   }
  }
 }
},
origin: org.apache.crunch/crunch-core

 @Override
 public Pair<K, Result<V>> map(Pair<K, Iterable<V>> input) {
  List<V> values = Lists.newArrayList(input.second().iterator());
  Collections.sort(values);
  return Pair.of(input.first(), new Result<V>(values.size(), findQuantiles(values.iterator(), values.size(), quantileList)));
 }
}
origin: spotify/crunch-lib

 @Override
 public Pair<K, Result<V>> map(Pair<K, Iterable<V>> input) {
  List<V> values = Lists.newArrayList(input.second().iterator());
  Collections.sort(values);
  return Pair.of(input.first(), new Result<V>(values.size(), findPercentiles(values.iterator(), values.size(), percentileList)));
 }
}
origin: cloudera/crunch

 @Override
 public void process(
   Pair<Pair<Integer, Integer>, Pair<Collection<U>, Collection<V>>> input,
   Emitter<Pair<U,V>> emitter) {
  for (U l: input.second().first()) {
   for (V r: input.second().second()) {
    emitter.emit(Pair.of(l, r));
   }
  }
 }
}, ctf.pairs(left.getPType(), right.getPType()));
org.apache.crunchPairfirst

Popular methods of Pair

  • of
  • second
  • <init>
  • cmp

Popular in Java

  • Making http post requests using okhttp
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • requestLocationUpdates (LocationManager)
  • getApplicationContext (Context)
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • Permission (java.security)
    Legacy security code; do not use.
  • Timer (java.util)
    Timers schedule one-shot or recurring TimerTask for execution. Prefer java.util.concurrent.Scheduled
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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