include "table_slice.fbs";
include "uuid.fbs";

namespace vast.fbs.interval;

/// A half-open interval *[a,b)* in the ID Space.
struct v0 {
  /// The left side of the interval (inclusive).
  begin: ulong = 0;

  /// The right side of the interval (exclusive).
  end: ulong = 0;
}

namespace vast.fbs.segment;

/// A bundled sequence of table slices.
table v0 {
  /// The contained table slices.
  slices: [FlatTableSlice];

  /// A unique identifier.
  uuid: uuid.v0;

  /// The ID intervals this segment covers.
  ids: [interval.v0];

  /// The number of events in the store.
  events: ulong;
}

union Segment {
  v0,
}

namespace vast.fbs;

table Segment {
  segment: segment.Segment;
}

root_type Segment;

file_identifier "vSEG";
