Skip to content

Commit

Permalink
WIP feat: support new comparator because of design
Browse files Browse the repository at this point in the history
add a pegasus comparator to support a normal users' sort.

Using new pegasus comparator will solve many scan timeout problems.
Pegasus can be compatible apps(tables) using the old comparator.
pegasus comparator will be the new table's default comparator.

more details at: apache#729
  • Loading branch information
duyuqi committed Jul 7, 2022
1 parent a4dd5d3 commit dd712ca
Show file tree
Hide file tree
Showing 9 changed files with 1,456 additions and 1,359 deletions.
740 changes: 344 additions & 396 deletions rdsn/include/dsn/cpp/serialization_helper/dsn.layer2_types.h

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions rdsn/src/dsn.layer2.thrift
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ enum app_status
AS_RECALLING
}

enum comparator_type
{
DEFAULT,
PEGASUS
}

struct app_info
{
1:app_status status = app_status.AS_INVALID;
Expand Down Expand Up @@ -100,4 +106,11 @@ struct app_info
// New fields for bulk load
// Whether this app is executing bulk load
14:optional bool is_bulk_loading = false;

// New fields for rocksdb comparator, Should not change it after app(table) created.
// "comparator_type.DEFAULT": BytesComparator,
// "comparator_type.PEGASUS": a new comparator defined by pegasus.
// new table will use "comparator_type.PEGASUS",
// if no comparator set, use "comparator_type.DEFAULT" for compatible.
15:optional comparator_type comparator = comparator_type.DEFAULT;
}
1 change: 1 addition & 0 deletions rdsn/src/meta/server_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1161,6 +1161,7 @@ void server_state::create_app(dsn::message_ex *msg)
info.status = app_status::AS_CREATING;
info.create_second = dsn_now_ms() / 1000;
info.init_partition_count = request.options.partition_count;
info.comparator = dsn::comparator_type::PEGASUS;

app = app_state::create(info);
app->helpers->pending_response = msg;
Expand Down
Loading

0 comments on commit dd712ca

Please sign in to comment.