@Test public void testUpsertPartitioner() throws Exception { final String testPartitionPath = "2016/09/26"; UpsertPartitioner partitioner = getUpsertPartitioner(0, 200, 100, 1024, testPartitionPath, false); List<InsertBucketCumulativeWeightPair> insertBuckets = partitioner.getInsertBuckets(testPartitionPath); assertEquals(2, insertBuckets.size(), "Total of 2 insert buckets"); }
public UpsertPartitioner(WorkloadProfile profile, HoodieEngineContext context, HoodieTable table, HoodieWriteConfig config) { updateLocationToBucket = new HashMap<>(); partitionPathToInsertBucketInfos = new HashMap<>(); bucketInfoMap = new HashMap<>(); this.profile = profile; this.table = table; this.config = config; assignUpdates(profile); assignInserts(profile, context); LOG.info("Total Buckets :" + totalBuckets + ", buckets info => " + bucketInfoMap + ", \n" + "Partition to insert buckets => " + partitionPathToInsertBucketInfos + ", \n" + "UpdateLocations mapped to buckets =>" + updateLocationToBucket); }
UpsertPartitioner extends Partitioner { public UpsertPartitioner(WorkloadProfile profile, HoodieEngineContext context, HoodieTable table, HoodieWriteConfig config) { updateLocationToBucket = new HashMap<>(); partitionPathToInsertBucketInfos = new HashMap<>(); bucketInfoMap = new HashMap<>(); this.profile = profile; this.table = table; this.config = config; assignUpdates(profile); assignInserts(profile, context); LOG.info("Total Buckets :" + totalBuckets + ", buckets info => " + bucketInfoMap + ", \n" + "Partition to insert buckets => " + partitionPathToInsertBucketInfos + ", \n" + "UpdateLocations mapped to buckets =>" + updateLocationToBucket); } }
UpsertPartitioner extends Partitioner { public UpsertPartitioner(WorkloadProfile profile, HoodieEngineContext context, HoodieTable table, HoodieWriteConfig config) { updateLocationToBucket = new HashMap<>(); partitionPathToInsertBucketInfos = new HashMap<>(); bucketInfoMap = new HashMap<>(); this.profile = profile; this.table = table; this.config = config; assignUpdates(profile); assignInserts(profile, context); LOG.info("Total Buckets :" + totalBuckets + ", buckets info => " + bucketInfoMap + ", \n" + "Partition to insert buckets => " + partitionPathToInsertBucketInfos + ", \n" + "UpdateLocations mapped to buckets =>" + updateLocationToBucket); } UpsertPartitioner(WorkloadProfile profile, HoodieEngineContext context, HoodieTable table,
      HoodieWriteConfig config); }
UpsertPartitioner extends Partitioner { public UpsertPartitioner(WorkloadProfile profile, HoodieEngineContext context, HoodieTable table, HoodieWriteConfig config) { updateLocationToBucket = new HashMap<>(); partitionPathToInsertBucketInfos = new HashMap<>(); bucketInfoMap = new HashMap<>(); this.profile = profile; this.table = table; this.config = config; assignUpdates(profile); assignInserts(profile, context); LOG.info("Total Buckets :" + totalBuckets + ", buckets info => " + bucketInfoMap + ", \n" + "Partition to insert buckets => " + partitionPathToInsertBucketInfos + ", \n" + "UpdateLocations mapped to buckets =>" + updateLocationToBucket); } UpsertPartitioner(WorkloadProfile profile, HoodieEngineContext context, HoodieTable table,
      HoodieWriteConfig config); BucketInfo getBucketInfo(int bucketNumber); List<InsertBucketCumulativeWeightPair> getInsertBuckets(String partitionPath); @Override int numPartitions(); @Override int getPartition(Object key); }
UpsertPartitioner extends Partitioner { public UpsertPartitioner(WorkloadProfile profile, HoodieEngineContext context, HoodieTable table, HoodieWriteConfig config) { updateLocationToBucket = new HashMap<>(); partitionPathToInsertBucketInfos = new HashMap<>(); bucketInfoMap = new HashMap<>(); this.profile = profile; this.table = table; this.config = config; assignUpdates(profile); assignInserts(profile, context); LOG.info("Total Buckets :" + totalBuckets + ", buckets info => " + bucketInfoMap + ", \n" + "Partition to insert buckets => " + partitionPathToInsertBucketInfos + ", \n" + "UpdateLocations mapped to buckets =>" + updateLocationToBucket); } UpsertPartitioner(WorkloadProfile profile, HoodieEngineContext context, HoodieTable table,
      HoodieWriteConfig config); BucketInfo getBucketInfo(int bucketNumber); List<InsertBucketCumulativeWeightPair> getInsertBuckets(String partitionPath); @Override int numPartitions(); @Override int getPartition(Object key);  }