@Test public void outOfBoundsShouldRejectTheNode() { when(node.getId()).thenReturn(199L); assertFalse(router.routeNode(randomizer.nextInt(), randomizer.nextInt(), node)); when(node.getId()).thenReturn(20000L); assertFalse(router.routeNode(randomizer.nextInt(), randomizer.nextInt(), node)); }
@Override public Boolean routeNode(int shardCount, int shardInstance, Node node) { long dbid = node.getId(); return dbid >= startRange && dbid < expandableRange.longValue(); }
DBIDRangeRouter implements DocRouter { @Override public Boolean routeNode(int shardCount, int shardInstance, Node node) { long dbid = node.getId(); return dbid >= startRange && dbid < expandableRange.longValue(); } }
DBIDRangeRouter implements DocRouter { @Override public Boolean routeNode(int shardCount, int shardInstance, Node node) { long dbid = node.getId(); return dbid >= startRange && dbid < expandableRange.longValue(); } DBIDRangeRouter(long startRange, long endRange); }
DBIDRangeRouter implements DocRouter { @Override public Boolean routeNode(int shardCount, int shardInstance, Node node) { long dbid = node.getId(); return dbid >= startRange && dbid < expandableRange.longValue(); } DBIDRangeRouter(long startRange, long endRange); void setEndRange(long endRange); void setExpanded(boolean expanded); void setInitialized(boolean initialized); boolean getInitialized(); long getEndRange(); long getStartRange(); boolean getExpanded(); @Override Boolean routeAcl(int shardCount, int shardInstance, Acl acl); @Override Boolean routeNode(int shardCount, int shardInstance, Node node); @Override Map<String, String> getProperties(Optional<QName> shardProperty); }
DBIDRangeRouter implements DocRouter { @Override public Boolean routeNode(int shardCount, int shardInstance, Node node) { long dbid = node.getId(); return dbid >= startRange && dbid < expandableRange.longValue(); } DBIDRangeRouter(long startRange, long endRange); void setEndRange(long endRange); void setExpanded(boolean expanded); void setInitialized(boolean initialized); boolean getInitialized(); long getEndRange(); long getStartRange(); boolean getExpanded(); @Override Boolean routeAcl(int shardCount, int shardInstance, Acl acl); @Override Boolean routeNode(int shardCount, int shardInstance, Node node); @Override Map<String, String> getProperties(Optional<QName> shardProperty);  }