@@ -0,0 +1,1158 @@
+package com.splicemachine.derby.stream.utils;%0A%0Aimport com.splicemachine.constants.bytes.BytesUtil;%0Aimport com.splicemachine.derby.stream.partitioner.MergePartitioner;%0Aimport com.splicemachine.mrio.api.core.SMSplit;%0Aimport org.apache.hadoop.mapreduce.InputSplit;%0Aimport org.apache.spark.Partition;%0Aimport org.apache.spark.Partitioner;%0Aimport org.apache.spark.rdd.NewHadoopPartition;%0Aimport java.util.ArrayList;%0Aimport java.util.Collections;%0Aimport java.util.List;%0A%0A/**%0A * Created by jleach on 6/9/15.%0A */%0Apublic class StreamPartitionUtils %7B%0A%0A    public Partitioner getPartitioner(int%5B%5D formatIds, Partition%5B%5D partitions) %7B%0A        List%3Cbyte%5B%5D%3E splits = new ArrayList%3C%3E();%0A        for (Partition p : partitions) %7B%0A            assert p instanceof NewHadoopPartition;%0A            NewHadoopPartition nhp = (NewHadoopPartition) p;%0A            InputSplit is = nhp.serializableHadoopSplit().value();%0A            assert is instanceof SMSplit;%0A            SMSplit ss = (SMSplit) is;%0A            splits.add(ss.getSplit().getEndRow());%0A        %7D%0A        Collections.sort(splits, BytesUtil.endComparator);%0A%0A        return new MergePartitioner(splits, formatIds);%0A    %7D%0A%7D%0A

Add Partition Info