public class StripingUtils extends Object
Modifier and Type | Method and Description |
---|---|
static <I extends org.apache.hadoop.io.WritableComparable> |
createSingleStripeBySendersFunction(Block block)
Given a block, creates a function that will given a predicate filter
calls to vertexSend function based on that predicate.
|
static int |
fastHash(long h)
Returns 32-bit hash of a given value.
|
static Obj2IntFunction<org.apache.hadoop.io.LongWritable> |
fastHashStriping(int stripes)
Fast hash-based striping for LongWritable IDs, returns a function
that for a given ID returns it's stripe index.
|
static Int2ObjFunction<Predicate<org.apache.hadoop.io.LongWritable>> |
fastHashStripingPredicate(int stripes)
Fast hash-based striping for LongWritable IDs, returns a function
that for a given stripe index returns a predicate checking whether ID is
in that stripe.
|
static int |
fastStripe(long value,
int stripes)
Returns number in [0, stripes) range, from given input
value . |
static <I extends org.apache.hadoop.io.WritableComparable> |
generateStripedBlock(int stripes,
Function<Predicate<I>,Block> blockGenerator,
Int2ObjFunction<Int2ObjFunction<Predicate<I>>> stripeSupplier)
Generate striped block, with given number of
stripes ,
using given blockGenerator to generate block for each stripe,
and using striping based on given stripeSupplier . |
static Block |
generateStripedBlock(int stripes,
Function<Predicate<org.apache.hadoop.io.LongWritable>,Block> blockGenerator)
Generate striped block, with given number of
stripes ,
using given blockGenerator to generate block for each stripe. |
static Block |
stripeBlockBySenders(int stripes,
Block block)
Stripe given block, by calling vertexSend only in it's corresponding
stripe.
|
public static int fastHash(long h)
public static int fastStripe(long value, int stripes)
value
.public static Obj2IntFunction<org.apache.hadoop.io.LongWritable> fastHashStriping(int stripes)
public static Int2ObjFunction<Predicate<org.apache.hadoop.io.LongWritable>> fastHashStripingPredicate(int stripes)
public static Block generateStripedBlock(int stripes, Function<Predicate<org.apache.hadoop.io.LongWritable>,Block> blockGenerator)
stripes
,
using given blockGenerator
to generate block for each stripe.stripes
- Number of stripesblockGenerator
- Function given predicate representing whether
ID is in current stripe, should return Block
for current stripepublic static <I extends org.apache.hadoop.io.WritableComparable> Block generateStripedBlock(int stripes, Function<Predicate<I>,Block> blockGenerator, Int2ObjFunction<Int2ObjFunction<Predicate<I>>> stripeSupplier)
stripes
,
using given blockGenerator
to generate block for each stripe,
and using striping based on given stripeSupplier
.stripes
- Number of stripesblockGenerator
- Function given predicate representing whether
ID is in current stripe, should return Block
for current stripestripeSupplier
- Function given number of stripes,
generates a function that given stripe index,
returns predicate checking whether ID is in that
stripe.public static Block stripeBlockBySenders(int stripes, Block block)
stripes
- Number of stripesblock
- Block to stripepublic static <I extends org.apache.hadoop.io.WritableComparable> Function<Predicate<I>,Block> createSingleStripeBySendersFunction(Block block)
Copyright © 2011-2020 The Apache Software Foundation. All Rights Reserved.