@Test public void testBalancerRegex() { FluoConfiguration fc = new FluoConfiguration(); RowHasher.configure(fc, "p", 3); TableOptimizations optimizations = new RowHasher.Optimizer().getTableOptimizations("p", fc.getAppConfiguration()); String regex = optimizations.getTabletGroupingRegex(); Assert.assertEquals("(\\Qp:\\E).*", regex); Assert.assertEquals(Arrays.asList(Bytes.of("p:c000"), Bytes.of("p:o000"), Bytes.of("p:~")), optimizations.getSplits()); }
public static void configure(FluoConfiguration fluoConfig, String prefix, int numTablets) { fluoConfig.getAppConfiguration().setProperty(PREFIX + prefix + ".numTablets", numTablets); TableOptimizations.registerOptimization(fluoConfig.getAppConfiguration(), prefix, Optimizer.class); }
RowHasher { public static void configure(FluoConfiguration fluoConfig, String prefix, int numTablets) { fluoConfig.getAppConfiguration().setProperty(PREFIX + prefix + ".numTablets", numTablets); TableOptimizations.registerOptimization(fluoConfig.getAppConfiguration(), prefix, Optimizer.class); } }
RowHasher { public static void configure(FluoConfiguration fluoConfig, String prefix, int numTablets) { fluoConfig.getAppConfiguration().setProperty(PREFIX + prefix + ".numTablets", numTablets); TableOptimizations.registerOptimization(fluoConfig.getAppConfiguration(), prefix, Optimizer.class); } RowHasher(String prefix); }
RowHasher { public static void configure(FluoConfiguration fluoConfig, String prefix, int numTablets) { fluoConfig.getAppConfiguration().setProperty(PREFIX + prefix + ".numTablets", numTablets); TableOptimizations.registerOptimization(fluoConfig.getAppConfiguration(), prefix, Optimizer.class); } RowHasher(String prefix); static void configure(FluoConfiguration fluoConfig, String prefix, int numTablets); String getPrefix(); Bytes addHash(String row); Bytes addHash(Bytes row); Bytes removeHash(Bytes row); }
RowHasher { public static void configure(FluoConfiguration fluoConfig, String prefix, int numTablets) { fluoConfig.getAppConfiguration().setProperty(PREFIX + prefix + ".numTablets", numTablets); TableOptimizations.registerOptimization(fluoConfig.getAppConfiguration(), prefix, Optimizer.class); } RowHasher(String prefix); static void configure(FluoConfiguration fluoConfig, String prefix, int numTablets); String getPrefix(); Bytes addHash(String row); Bytes addHash(Bytes row); Bytes removeHash(Bytes row);  }