test_class.declarator: availableTablesForMonthStrategy = new LinkedList<>()
test_class.modifier: private final
test_class.original_string: private final Collection<String> availableTablesForMonthStrategy = new LinkedList<>();
test_class.type: Collection<String>
test_class.var_name: availableTablesForMonthStrategy
test_class.declarator: availableTablesForQuarterStrategy = new LinkedList<>()
test_class.modifier: private final
test_class.original_string: private final Collection<String> availableTablesForQuarterStrategy = new LinkedList<>();
test_class.type: Collection<String>
test_class.var_name: availableTablesForQuarterStrategy
test_class.declarator: shardingStrategyByMonth
test_class.modifier: private
test_class.original_string: private StandardShardingStrategy shardingStrategyByMonth;
test_class.type: StandardShardingStrategy
test_class.var_name: shardingStrategyByMonth
test_class.declarator: shardingStrategyByQuarter
test_class.modifier: private
test_class.original_string: private StandardShardingStrategy shardingStrategyByQuarter;
test_class.type: StandardShardingStrategy
test_class.var_name: shardingStrategyByQuarter
test_class.file: shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-common/src/test/java/org/apache/shardingsphere/sharding/algorithm/sharding/datetime/IntervalShardingAlgorithmTest.java
test_class.identifier: IntervalShardingAlgorithmTest
test_case.body: @Test
      public void assertRangeDoShardingByMonth() {
          Range<String> rangeValue = Range.closed("2019-10-15 10:59:08", "2020-04-08 10:59:08");
          List<RouteValue> shardingValues = Collections.singletonList(new RangeRouteValue<>("create_time", "t_order", rangeValue));
          Collection<String> actual = shardingStrategyByMonth.doSharding(availableTablesForMonthStrategy, shardingValues, new ConfigurationProperties(new Properties()));
          assertThat(actual.size(), is(7));
      }
test_case.class_method_signature: IntervalShardingAlgorithmTest.assertRangeDoShardingByMonth()
test_case.full_signature: @Test public void assertRangeDoShardingByMonth()
test_case.identifier: assertRangeDoShardingByMonth
test_case.invocations: closed singletonList doSharding assertThat size is
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void assertRangeDoShardingByMonth()
focal_class.declarator: DATE_TIME_PATTERN_KEY = "datetime-pattern"
focal_class.modifier: private static final
focal_class.original_string: private static final String DATE_TIME_PATTERN_KEY = "datetime-pattern";
focal_class.type: String
focal_class.var_name: DATE_TIME_PATTERN_KEY
focal_class.declarator: DATE_TIME_LOWER_KEY = "datetime-lower"
focal_class.modifier: private static final
focal_class.original_string: private static final String DATE_TIME_LOWER_KEY = "datetime-lower";
focal_class.type: String
focal_class.var_name: DATE_TIME_LOWER_KEY
focal_class.declarator: DATE_TIME_UPPER_KEY = "datetime-upper"
focal_class.modifier: private static final
focal_class.original_string: private static final String DATE_TIME_UPPER_KEY = "datetime-upper";
focal_class.type: String
focal_class.var_name: DATE_TIME_UPPER_KEY
focal_class.declarator: SHARDING_SUFFIX_FORMAT_KEY = "sharding-suffix-pattern"
focal_class.modifier: private static final
focal_class.original_string: private static final String SHARDING_SUFFIX_FORMAT_KEY = "sharding-suffix-pattern";
focal_class.type: String
focal_class.var_name: SHARDING_SUFFIX_FORMAT_KEY
focal_class.declarator: INTERVAL_AMOUNT_KEY = "datetime-interval-amount"
focal_class.modifier: private static final
focal_class.original_string: private static final String INTERVAL_AMOUNT_KEY = "datetime-interval-amount";
focal_class.type: String
focal_class.var_name: INTERVAL_AMOUNT_KEY
focal_class.declarator: INTERVAL_UNIT_KEY = "datetime-interval-unit"
focal_class.modifier: private static final
focal_class.original_string: private static final String INTERVAL_UNIT_KEY = "datetime-interval-unit";
focal_class.type: String
focal_class.var_name: INTERVAL_UNIT_KEY
focal_class.declarator: props = new Properties()
focal_class.modifier: @Getter
      @Setter
      private
focal_class.original_string: @Getter
      @Setter
      private Properties props = new Properties();
focal_class.type: Properties
focal_class.var_name: props
focal_class.declarator: dateTimeFormatter
focal_class.modifier: private
focal_class.original_string: private DateTimeFormatter dateTimeFormatter;
focal_class.type: DateTimeFormatter
focal_class.var_name: dateTimeFormatter
focal_class.declarator: dateTimePatternLength
focal_class.modifier: private
focal_class.original_string: private int dateTimePatternLength;
focal_class.type: int
focal_class.var_name: dateTimePatternLength
focal_class.declarator: dateTimeLower
focal_class.modifier: private
focal_class.original_string: private LocalDateTime dateTimeLower;
focal_class.type: LocalDateTime
focal_class.var_name: dateTimeLower
focal_class.declarator: dateTimeUpper
focal_class.modifier: private
focal_class.original_string: private LocalDateTime dateTimeUpper;
focal_class.type: LocalDateTime
focal_class.var_name: dateTimeUpper
focal_class.declarator: tableSuffixPattern
focal_class.modifier: private
focal_class.original_string: private DateTimeFormatter tableSuffixPattern;
focal_class.type: DateTimeFormatter
focal_class.var_name: tableSuffixPattern
focal_class.declarator: stepAmount
focal_class.modifier: private
focal_class.original_string: private int stepAmount;
focal_class.type: int
focal_class.var_name: stepAmount
focal_class.declarator: stepUnit
focal_class.modifier: private
focal_class.original_string: private ChronoUnit stepUnit;
focal_class.type: ChronoUnit
focal_class.var_name: stepUnit
focal_class.file: shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-common/src/main/java/org/apache/shardingsphere/sharding/algorithm/sharding/datetime/IntervalShardingAlgorithm.java
focal_class.identifier: IntervalShardingAlgorithm
focal_class.interfaces: implements StandardShardingAlgorithm<Comparable<?>>
focal_class.class_method_signature: IntervalShardingAlgorithm.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: IntervalShardingAlgorithm.getDateTimePattern()
focal_class.full_signature: private String getDateTimePattern()
focal_class.identifier: getDateTimePattern
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getDateTimePattern()
focal_class.class_method_signature: IntervalShardingAlgorithm.getDateTimeLower(final String dateTimePattern)
focal_class.full_signature: private LocalDateTime getDateTimeLower(final String dateTimePattern)
focal_class.identifier: getDateTimeLower
focal_class.modifiers: private
focal_class.parameters: (final String dateTimePattern)
focal_class.return: LocalDateTime
focal_class.signature: LocalDateTime getDateTimeLower(final String dateTimePattern)
focal_class.class_method_signature: IntervalShardingAlgorithm.getDateTimeUpper(final String dateTimePattern)
focal_class.full_signature: private LocalDateTime getDateTimeUpper(final String dateTimePattern)
focal_class.identifier: getDateTimeUpper
focal_class.modifiers: private
focal_class.parameters: (final String dateTimePattern)
focal_class.return: LocalDateTime
focal_class.signature: LocalDateTime getDateTimeUpper(final String dateTimePattern)
focal_class.class_method_signature: IntervalShardingAlgorithm.getDateTime(final String dateTimeKey, final String dateTimeValue, final String dateTimePattern)
focal_class.full_signature: private LocalDateTime getDateTime(final String dateTimeKey, final String dateTimeValue, final String dateTimePattern)
focal_class.identifier: getDateTime
focal_class.modifiers: private
focal_class.parameters: (final String dateTimeKey, final String dateTimeValue, final String dateTimePattern)
focal_class.return: LocalDateTime
focal_class.signature: LocalDateTime getDateTime(final String dateTimeKey, final String dateTimeValue, final String dateTimePattern)
focal_class.class_method_signature: IntervalShardingAlgorithm.getTableSuffixPattern()
focal_class.full_signature: private DateTimeFormatter getTableSuffixPattern()
focal_class.identifier: getTableSuffixPattern
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: DateTimeFormatter
focal_class.signature: DateTimeFormatter getTableSuffixPattern()
focal_class.class_method_signature: IntervalShardingAlgorithm.getStepUnit(final String stepUnit)
focal_class.full_signature: private ChronoUnit getStepUnit(final String stepUnit)
focal_class.identifier: getStepUnit
focal_class.modifiers: private
focal_class.parameters: (final String stepUnit)
focal_class.return: ChronoUnit
focal_class.signature: ChronoUnit getStepUnit(final String stepUnit)
focal_class.class_method_signature: IntervalShardingAlgorithm.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: IntervalShardingAlgorithm.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: IntervalShardingAlgorithm.parseDateTime(final String value)
focal_class.full_signature: private LocalDateTime parseDateTime(final String value)
focal_class.identifier: parseDateTime
focal_class.modifiers: private
focal_class.parameters: (final String value)
focal_class.return: LocalDateTime
focal_class.signature: LocalDateTime parseDateTime(final String value)
focal_class.class_method_signature: IntervalShardingAlgorithm.getMatchedTables(final LocalDateTime dateTime, final Collection<String> availableTargetNames)
focal_class.full_signature: private Collection<String> getMatchedTables(final LocalDateTime dateTime, final Collection<String> availableTargetNames)
focal_class.identifier: getMatchedTables
focal_class.modifiers: private
focal_class.parameters: (final LocalDateTime dateTime, final Collection<String> availableTargetNames)
focal_class.return: Collection<String>
focal_class.signature: Collection<String> getMatchedTables(final LocalDateTime dateTime, final Collection<String> availableTargetNames)
focal_class.class_method_signature: IntervalShardingAlgorithm.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) {
          return availableTargetNames.stream()
                  .filter(each -> each.endsWith(parseDateTime(shardingValue.getValue().toString()).format(tableSuffixPattern)))
                  .findFirst().orElseThrow(() -> new ShardingAlgorithmException(String.format("failed to shard value %s, and availableTables %s", shardingValue, availableTargetNames)));
      }
focal_method.class_method_signature: IntervalShardingAlgorithm.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: orElseThrow findFirst filter stream endsWith format parseDateTime toString getValue format
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)