featurebase/internal/internal.proto
Ben Johnson eff08af112 Separate physical data layout with views.
Previously, multiple frames with different prefixes were used to separate
different data layouts. This included separating standard row/column
layouts from inverted column/row layouts as well as storing aggregate
information for timestamp data.

Unfortunately, this caused frame meta data to be copied between multiple
frames and it made it difficult to keep these frames in sync.

This commit separates these different physical layouts into `Views`.
A `Frame` now has one or more views which represent each layout.
Fragments have been moved from under the `Frame` to be contained
within the `View`.

There are two primary views:

- `standard`
- `inverse`

If a frame has a time quantum, then views are generated for these
each of the standard/inverse views. For example a time quantum
of `YMDH` for the date `2000-01-02T00:00:00Z` would create the
following views:

- `standard_2000`
- `inverse_2000`
- `standard_200001`
- `inverse_200001`
- `standard_20000102`
- `inverse_20000102`

From the user's perspective, nothing should change in PQL. Different
PQL statements will handle the appropriate view automatically. For
example, `Bitmap()` and `Profile()` will fetch using the `standard`
view or the `inverse` view, respectively. The `Range()` statement
will lookup the appropriate time-based views automatically.
2017-03-24 13:57:02 -06:00

104 lines
1.5 KiB
Protocol Buffer

syntax = "proto3";
package internal;
message DB {
string TimeQuantum = 1;
string ColumnLabel = 2;
}
message Frame {
string TimeQuantum = 1;
string RowLabel = 2;
}
message Bitmap {
repeated uint64 Bits = 1;
repeated Attr Attrs = 2;
}
message Pair {
uint64 Key = 1;
uint64 Count = 2;
}
message Bit {
uint64 BitmapID = 1;
uint64 ProfileID = 2;
int64 Timestamp = 3;
}
message Profile {
uint64 ID = 1;
repeated Attr Attrs = 2;
}
message Attr {
string Key = 1;
uint64 Type = 2;
string StringValue = 3;
uint64 UintValue = 4;
bool BoolValue = 5;
double FloatValue = 6;
}
message AttrMap {
repeated Attr Attrs = 1;
}
message QueryRequest {
string DB = 1;
string Query = 2;
repeated uint64 Slices = 3;
bool Profiles = 4;
string Quantum = 5;
bool Remote = 6;
}
message QueryResponse {
string Err = 1;
repeated QueryResult Results = 2;
repeated Profile Profiles = 3;
}
message QueryResult {
Bitmap Bitmap = 1;
uint64 N = 2;
repeated Pair Pairs = 3;
bool Changed = 4;
}
message ImportRequest {
string DB = 1;
string Frame = 2;
uint64 Slice = 3;
repeated uint64 BitmapIDs = 4;
repeated uint64 ProfileIDs = 5;
repeated int64 Timestamps = 6;
}
message ImportResponse {
string Err = 1;
}
message BlockDataRequest {
string DB = 1;
string Frame = 2;
string View = 5;
uint64 Slice = 4;
uint64 Block = 3;
}
message BlockDataResponse {
repeated uint64 BitmapIDs = 1;
repeated uint64 ProfileIDs = 2;
}
message Cache {
repeated uint64 BitmapIDs = 1;
}
message MaxSlicesResponse {
map<string, uint64> MaxSlices = 1;
}