Search in sources :

Example 6 with CompactionPartition

use of org.apache.hadoop.hbase.mob.compactions.PartitionedMobCompactionRequest.CompactionPartition in project hbase by apache.

the class TestPartitionedMobCompactor method compareCompactedPartitions.

/**
   * Compares the compacted partitions.
   * @param partitions the collection of CompactedPartitions
   */
private void compareCompactedPartitions(List<String> expected, Collection<CompactionPartition> partitions) {
    List<String> actualKeys = new ArrayList<>();
    for (CompactionPartition partition : partitions) {
        actualKeys.add(partition.getPartitionId().getStartKey());
    }
    Collections.sort(expected);
    Collections.sort(actualKeys);
    Assert.assertEquals(expected.size(), actualKeys.size());
    for (int i = 0; i < expected.size(); i++) {
        Assert.assertEquals(expected.get(i), actualKeys.get(i));
    }
}
Also used : CompactionPartition(org.apache.hadoop.hbase.mob.compactions.PartitionedMobCompactionRequest.CompactionPartition)

Aggregations

CompactionPartition (org.apache.hadoop.hbase.mob.compactions.PartitionedMobCompactionRequest.CompactionPartition)6 Path (org.apache.hadoop.fs.Path)4 CompactionPartitionId (org.apache.hadoop.hbase.mob.compactions.PartitionedMobCompactionRequest.CompactionPartitionId)3 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 FileStatus (org.apache.hadoop.fs.FileStatus)2 CompactionDelPartition (org.apache.hadoop.hbase.mob.compactions.PartitionedMobCompactionRequest.CompactionDelPartition)2 Test (org.junit.Test)2 FileNotFoundException (java.io.FileNotFoundException)1 IOException (java.io.IOException)1 Calendar (java.util.Calendar)1 Date (java.util.Date)1 Map (java.util.Map)1 NavigableMap (java.util.NavigableMap)1 TreeMap (java.util.TreeMap)1 Callable (java.util.concurrent.Callable)1 Future (java.util.concurrent.Future)1 Connection (org.apache.hadoop.hbase.client.Connection)1 MobCompactPartitionPolicy (org.apache.hadoop.hbase.client.MobCompactPartitionPolicy)1 Table (org.apache.hadoop.hbase.client.Table)1