test_class.declarator: shardingStrategy
test_class.modifier: private
test_class.original_string: private StandardShardingStrategy shardingStrategy;
test_class.type: StandardShardingStrategy
test_class.var_name: shardingStrategy
test_class.file: shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-common/src/test/java/org/apache/shardingsphere/sharding/algorithm/sharding/mod/ModShardingAlgorithmTest.java
test_class.identifier: ModShardingAlgorithmTest
test_case.body: @Test
      public void assertRangeDoShardingWithPartTargets() {
          List<String> availableTargetNames = Lists.newArrayList("t_order_0", "t_order_1", "t_order_2", "t_order_3");
          Range<Long> rangeValue = Range.closed(11L, 12L);
          List<RouteValue> shardingValues = Lists.newArrayList(new RangeRouteValue<>("order_id", "t_order", rangeValue));
          Collection<String> actual = shardingStrategy.doSharding(availableTargetNames, shardingValues, new ConfigurationProperties(new Properties()));
          assertThat(actual.size(), is(2));
          assertTrue(actual.contains("t_order_3"));
          assertTrue(actual.contains("t_order_0"));
      }
test_case.class_method_signature: ModShardingAlgorithmTest.assertRangeDoShardingWithPartTargets()
test_case.full_signature: @Test public void assertRangeDoShardingWithPartTargets()
test_case.identifier: assertRangeDoShardingWithPartTargets
test_case.invocations: newArrayList closed newArrayList doSharding assertThat size is assertTrue contains assertTrue contains
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void assertRangeDoShardingWithPartTargets()
focal_class.declarator: SHARDING_COUNT_KEY = "sharding-count"
focal_class.modifier: private static final
focal_class.original_string: private static final String SHARDING_COUNT_KEY = "sharding-count";
focal_class.type: String
focal_class.var_name: SHARDING_COUNT_KEY
focal_class.declarator: props = new Properties()
focal_class.modifier: private
focal_class.original_string: private Properties props = new Properties();
focal_class.type: Properties
focal_class.var_name: props
focal_class.declarator: shardingCount
focal_class.modifier: private
focal_class.original_string: private int shardingCount;
focal_class.type: int
focal_class.var_name: shardingCount
focal_class.file: shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-common/src/main/java/org/apache/shardingsphere/sharding/algorithm/sharding/mod/ModShardingAlgorithm.java
focal_class.identifier: ModShardingAlgorithm
focal_class.interfaces: implements StandardShardingAlgorithm<Comparable<?>>, ShardingAutoTableAlgorithm
focal_class.class_method_signature: ModShardingAlgorithm.init()
focal_class.full_signature: @Override public void init()
focal_class.identifier: init
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void init()
focal_class.class_method_signature: ModShardingAlgorithm.getShardingCount()
focal_class.full_signature: private int getShardingCount()
focal_class.identifier: getShardingCount
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int getShardingCount()
focal_class.class_method_signature: ModShardingAlgorithm.doSharding(final Collection<String> availableTargetNames, final PreciseShardingValue<Comparable<?>> shardingValue)
focal_class.full_signature: @Override public String doSharding(final Collection<String> availableTargetNames, final PreciseShardingValue<Comparable<?>> shardingValue)
focal_class.identifier: doSharding
focal_class.modifiers: @Override public
focal_class.parameters: (final Collection<String> availableTargetNames, final PreciseShardingValue<Comparable<?>> shardingValue)
focal_class.return: String
focal_class.signature: String doSharding(final Collection<String> availableTargetNames, final PreciseShardingValue<Comparable<?>> shardingValue)
focal_class.class_method_signature: ModShardingAlgorithm.doSharding(final Collection<String> availableTargetNames, final RangeShardingValue<Comparable<?>> shardingValue)
focal_class.full_signature: @Override public Collection<String> doSharding(final Collection<String> availableTargetNames, final RangeShardingValue<Comparable<?>> shardingValue)
focal_class.identifier: doSharding
focal_class.modifiers: @Override public
focal_class.parameters: (final Collection<String> availableTargetNames, final RangeShardingValue<Comparable<?>> shardingValue)
focal_class.return: Collection<String>
focal_class.signature: Collection<String> doSharding(final Collection<String> availableTargetNames, final RangeShardingValue<Comparable<?>> shardingValue)
focal_class.class_method_signature: ModShardingAlgorithm.isContainAllTargets(final RangeShardingValue<Comparable<?>> shardingValue)
focal_class.full_signature: private boolean isContainAllTargets(final RangeShardingValue<Comparable<?>> shardingValue)
focal_class.identifier: isContainAllTargets
focal_class.modifiers: private
focal_class.parameters: (final RangeShardingValue<Comparable<?>> shardingValue)
focal_class.return: boolean
focal_class.signature: boolean isContainAllTargets(final RangeShardingValue<Comparable<?>> shardingValue)
focal_class.class_method_signature: ModShardingAlgorithm.getAvailableTargetNames(final Collection<String> availableTargetNames, final RangeShardingValue<Comparable<?>> shardingValue)
focal_class.full_signature: private Collection<String> getAvailableTargetNames(final Collection<String> availableTargetNames, final RangeShardingValue<Comparable<?>> shardingValue)
focal_class.identifier: getAvailableTargetNames
focal_class.modifiers: private
focal_class.parameters: (final Collection<String> availableTargetNames, final RangeShardingValue<Comparable<?>> shardingValue)
focal_class.return: Collection<String>
focal_class.signature: Collection<String> getAvailableTargetNames(final Collection<String> availableTargetNames, final RangeShardingValue<Comparable<?>> shardingValue)
focal_class.class_method_signature: ModShardingAlgorithm.getLongValue(final Comparable<?> value)
focal_class.full_signature: private long getLongValue(final Comparable<?> value)
focal_class.identifier: getLongValue
focal_class.modifiers: private
focal_class.parameters: (final Comparable<?> value)
focal_class.return: long
focal_class.signature: long getLongValue(final Comparable<?> value)
focal_class.class_method_signature: ModShardingAlgorithm.getAutoTablesAmount()
focal_class.full_signature: @Override public int getAutoTablesAmount()
focal_class.identifier: getAutoTablesAmount
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int getAutoTablesAmount()
focal_class.class_method_signature: ModShardingAlgorithm.getType()
focal_class.full_signature: @Override public String getType()
focal_class.identifier: getType
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getType()
focal_method.body: @Override
      public String doSharding(final Collection<String> availableTargetNames, final PreciseShardingValue<Comparable<?>> shardingValue) {
          for (String each : availableTargetNames) {
              if (each.endsWith(String.valueOf(getLongValue(shardingValue.getValue()) % shardingCount))) {
                  return each;
              }
          }
          return null;
      }
focal_method.class_method_signature: ModShardingAlgorithm.doSharding(final Collection<String> availableTargetNames, final PreciseShardingValue<Comparable<?>> shardingValue)
focal_method.full_signature: @Override public String doSharding(final Collection<String> availableTargetNames, final PreciseShardingValue<Comparable<?>> shardingValue)
focal_method.identifier: doSharding
focal_method.invocations: endsWith valueOf getLongValue getValue
focal_method.modifiers: @Override public
focal_method.parameters: (final Collection<String> availableTargetNames, final PreciseShardingValue<Comparable<?>> shardingValue)
focal_method.return: String
focal_method.signature: String doSharding(final Collection<String> availableTargetNames, final PreciseShardingValue<Comparable<?>> shardingValue)