コード例 #1
0
  private static RowKeySchema buildSchema(int[] widths) {
    RowKeySchemaBuilder builder = new RowKeySchemaBuilder().setMinNullable(10);
    for (final int width : widths) {
      builder.addField(
          new PDatum() {
            @Override
            public boolean isNullable() {
              return false;
            }

            @Override
            public PDataType getDataType() {
              return PDataType.CHAR;
            }

            @Override
            public Integer getByteSize() {
              return width;
            }

            @Override
            public Integer getMaxLength() {
              return width;
            }

            @Override
            public Integer getScale() {
              return null;
            }

            @Override
            public ColumnModifier getColumnModifier() {
              return null;
            }
          });
    }
    return builder.build();
  }
コード例 #2
0
  public SkipScanFilterTest(
      List<List<KeyRange>> cnf, int[] widths, List<Expectation> expectations) {
    this.expectations = expectations;
    this.cnf = cnf;
    RowKeySchemaBuilder builder = new RowKeySchemaBuilder().setMinNullable(10);
    for (final int width : widths) {
      builder.addField(
          new PDatum() {

            @Override
            public boolean isNullable() {
              return false;
            }

            @Override
            public PDataType getDataType() {
              return PDataType.CHAR;
            }

            @Override
            public Integer getByteSize() {
              return width;
            }

            @Override
            public Integer getMaxLength() {
              return width;
            }

            @Override
            public Integer getScale() {
              return null;
            }
          });
    }
    skipper = new SkipScanFilter(cnf, builder.build());
  }