@Test public void testFixedSizedRange() { checkParser(new PartitionStrategy.Builder().fixedSizeRange("id", 64).build(), "[ {\"type\": \"range\", \"source\": \"id\", \"size\": 64} ]"); checkParser(new PartitionStrategy.Builder().fixedSizeRange("id", "rng", 64).build(), "[ {\"type\": \"range\", " + "\"source\": \"id\", " + "\"name\": \"rng\", " + "\"size\": 64} ]" ); TestHelpers.assertThrows("Should reject missing size", ValidationException.class, new Runnable() { @Override public void run() { PartitionStrategyParser.parse("[ {\"type\": \"range\", " + "\"source\": \"id\", " + "\"name\": \"rng\"} ]"); } } ); TestHelpers.assertThrows("Should reject invalid size", ValidationException.class, new Runnable() { @Override public void run() { PartitionStrategyParser.parse("[ {\"type\": \"range\", " + "\"source\": \"id\", " + "\"name\": \"rng\", " + "\"size\": \"green\"} ]"); } } ); }
public static PartitionStrategy parse(String json) { return buildPartitionStrategy(JsonUtil.parse(json)); }
PartitionStrategyParser { public static PartitionStrategy parse(String json) { return buildPartitionStrategy(JsonUtil.parse(json)); } }
PartitionStrategyParser { public static PartitionStrategy parse(String json) { return buildPartitionStrategy(JsonUtil.parse(json)); }  }
PartitionStrategyParser { public static PartitionStrategy parse(String json) { return buildPartitionStrategy(JsonUtil.parse(json)); }  static PartitionStrategy parse(String json); static PartitionStrategy parse(File file); static PartitionStrategy parse(InputStream in); static boolean hasEmbeddedStrategy(Schema schema); static PartitionStrategy parseFromSchema(Schema schema); static Schema removeEmbeddedStrategy(Schema schema); static Schema embedPartitionStrategy(Schema schema, PartitionStrategy strategy); static String toString(PartitionStrategy strategy, boolean pretty); }
PartitionStrategyParser { public static PartitionStrategy parse(String json) { return buildPartitionStrategy(JsonUtil.parse(json)); }  static PartitionStrategy parse(String json); static PartitionStrategy parse(File file); static PartitionStrategy parse(InputStream in); static boolean hasEmbeddedStrategy(Schema schema); static PartitionStrategy parseFromSchema(Schema schema); static Schema removeEmbeddedStrategy(Schema schema); static Schema embedPartitionStrategy(Schema schema, PartitionStrategy strategy); static String toString(PartitionStrategy strategy, boolean pretty);  }