TerrapinUtil { public static int getBucketSize(int numPartitions, boolean enableZkCompression) { if (enableZkCompression) { return 0; } int numBuckets = (int)Math.ceil((double)numPartitions / 1000); if (numBuckets <= 1) { return 0; } return (int)Math.ceil((double)numPartitions / numBuckets); }  static String getHelixInstanceFromHDFSHost(String hdfsHostName); static PropertiesConfiguration readPropertiesExitOnFailure(String configFile); static Integer extractPartitionName(String fileName, PartitionerType partitioner); static String formatPartitionName(int partitionNumber); static String getPartitionName(ByteBuffer key,
                                        PartitionerType partitionerType,
                                        int numPartitions); static String hdfsDirToHelixResource(String hdfsDir); static String helixResourceToHdfsDir(String helixResource); static ZooKeeperClient getZooKeeperClient(String zkQuorum, int sessionTimeoutSeconds); static int getBucketSize(int numPartitions, boolean enableZkCompression); static String extractFileSetFromPath(String resource); static Pair<String, Integer> getBucketizedResourceAndPartitionNum(String helixPartition); static Pair<String, Integer> getNonBucketizedResourceAndPartitionNum(
      String helixPartition); static Pair<String, Integer> getResourceAndPartitionNum(String helixPartition); static String getViewPartitionName(String resource, int partition); static int getViewPartitionNumber(String viewPartitionName); static void compressIdealState(IdealState is); static String getZKQuorumFromConf(PropertiesConfiguration configuration); static List<HdfsFileStatus> getHdfsFileList(DFSClient hdfsClient,
                                                     String hdfsDir); static void loadFileSetData(ZooKeeperManager zkManager, FileSetInfo fsInfo, Options options); static List<Pair<Path, Long>> getS3FileList(AWSCredentials credentials,
      String s3Bucket, String s3KeyPrefix); static void setupConfiguration(Configuration conf,
                                        long dfsBlockSize,
                                        int dfsReplication);  }
@Test public void testGetBucketSize() { assertEquals(0, TerrapinUtil.getBucketSize(600, false)); assertEquals(701, TerrapinUtil.getBucketSize(1401, false)); assertEquals(1000, TerrapinUtil.getBucketSize(3000, false)); assertEquals(751, TerrapinUtil.getBucketSize(3001, false)); assertEquals(0, TerrapinUtil.getBucketSize(600, true)); assertEquals(0, TerrapinUtil.getBucketSize(1401, true)); assertEquals(0, TerrapinUtil.getBucketSize(3000, true)); assertEquals(0, TerrapinUtil.getBucketSize(3001, true)); }