<commit_before>/**
 * Communication protocol between Event Managers.
 * @author <NAME>
 * @copyright (C) 2015 ACK CYFRONET AGH
 * @copyright This software is released under the MIT license cited in
 * 'LICENSE.txt'
 */

package one.clproto;

import "common_messages.proto";
import "fuse_messages.proto";

// Generic event message
message Event {
    required uint32 counter = 1; // amount of aggregated events
    oneof event { // list of all event messages
        ReadEvent   read_event   = 2;
        WriteEvent  write_event  = 3;
        UpdateEvent update_event = 4;
    }
}

message ReadEvent {
    required bytes     file_uuid = 1; // UUID of file associated with an event
    required uint64    size      = 2; // amount of read bytes
    repeated FileBlock blocks    = 3; // list of read blocks
}

message WriteEvent {
    required bytes     file_uuid = 1; // UUID of file associated with an event
    optional uint64    file_size = 2; // size of file associated with an event
    required uint64    size      = 3; // amount of written bytes
    repeated FileBlock blocks    = 4; // list of written blocks
}

message UpdateEvent {
    oneof update_event {
        FileAttr     file_attr     = 1;
        FileLocation file_location = 2;
    }
}

// Generic subscription message
message Subscription {
    required int64 id = 1; // unique subscription ID
    oneof event_subscription { // list of all subscription messages
        ReadSubscription         read_subscription          = 2;
        WriteSubscription        write_subscription         = 3;
        FileAttrSubscription     file_attr_subscription     = 4;
        FileLocationSubscription file_location_subscription = 5;
    }
}

message ReadSubscription {
    optional uint32 counter_threshold = 1; // maximal amount of aggregated
                                           // events before emission
    optional uint32 time_threshold    = 2; // maximal delay in milliseconds
                                           // between successive events emission
    optional uint32 size_threshold    = 3; // maximal amount of read bytes
                                           // before emission
}

message WriteSubscription {
    optional uint32 counter_threshold = 1; // maximal amount of aggregated
                                           // events before emission
    optional uint32 time_threshold    = 2; // maximal delay in milliseconds
                                           // between successive events emission
    optional uint32 size_threshold    = 3; // maximal amount of written bytes
                                           // before emission
}

message FileAttrSubscription {
    required bytes  file_uuid         = 1; // file UUID
    optional uint32 counter_threshold = 2; // maximal amount of aggregated
                                           // events before emission
    optional uint32 time_threshold    = 3; // maximal delay in milliseconds
                                           // between successive events emission
}

message FileLocationSubscription {
    required bytes  file_uuid         = 1; // file UUID
    optional uint32 counter_threshold = 2; // maximal amount of aggregated
                                           // events before emission
    optional uint32 time_threshold    = 3; // maximal delay in milliseconds
                                           // between successive events emission
}

message SubscriptionCancellation {
    required int64 id = 1; // ID of subscription to be cancelled
}<commit_msg>VFS-1289 Change name of 'oneof' constructions in event messages.<commit_after>/**
 * Communication protocol between Event Managers.
 * @author <NAME>
 * @copyright (C) 2015 ACK CYFRONET AGH
 * @copyright This software is released under the MIT license cited in
 * 'LICENSE.txt'
 */

package one.clproto;

import "common_messages.proto";
import "fuse_messages.proto";

// Generic event message
message Event {
    required uint32 counter = 1; // amount of aggregated events
    oneof type { // list of all event types
        ReadEvent   read_event   = 2;
        WriteEvent  write_event  = 3;
        UpdateEvent update_event = 4;
    }
}

message ReadEvent {
    required bytes     file_uuid = 1; // UUID of file associated with an event
    required uint64    size      = 2; // amount of read bytes
    repeated FileBlock blocks    = 3; // list of read blocks
}

message WriteEvent {
    required bytes     file_uuid = 1; // UUID of file associated with an event
    optional uint64    file_size = 2; // size of file associated with an event
    required uint64    size      = 3; // amount of written bytes
    repeated FileBlock blocks    = 4; // list of written blocks
}

message UpdateEvent {
    oneof type { // list of all update event types
        FileAttr     file_attr     = 1;
        FileLocation file_location = 2;
    }
}

// Generic subscription message
message Subscription {
    required int64 id = 1; // unique subscription ID
    oneof type { // list of all subscription types
        ReadSubscription         read_subscription          = 2;
        WriteSubscription        write_subscription         = 3;
        FileAttrSubscription     file_attr_subscription     = 4;
        FileLocationSubscription file_location_subscription = 5;
    }
}

message ReadSubscription {
    optional uint32 counter_threshold = 1; // maximal amount of aggregated
                                           // events before emission
    optional uint32 time_threshold    = 2; // maximal delay in milliseconds
                                           // between successive events emission
    optional uint32 size_threshold    = 3; // maximal amount of read bytes
                                           // before emission
}

message WriteSubscription {
    optional uint32 counter_threshold = 1; // maximal amount of aggregated
                                           // events before emission
    optional uint32 time_threshold    = 2; // maximal delay in milliseconds
                                           // between successive events emission
    optional uint32 size_threshold    = 3; // maximal amount of written bytes
                                           // before emission
}

message FileAttrSubscription {
    required bytes  file_uuid         = 1; // file UUID
    optional uint32 counter_threshold = 2; // maximal amount of aggregated
                                           // events before emission
    optional uint32 time_threshold    = 3; // maximal delay in milliseconds
                                           // between successive events emission
}

message FileLocationSubscription {
    required bytes  file_uuid         = 1; // file UUID
    optional uint32 counter_threshold = 2; // maximal amount of aggregated
                                           // events before emission
    optional uint32 time_threshold    = 3; // maximal delay in milliseconds
                                           // between successive events emission
}

message SubscriptionCancellation {
    required int64 id = 1; // ID of subscription to be cancelled
}

{'fraction_non_alphanumeric': 0.055251717851633714, 'fraction_numerical': 0.019352124526714348, 'mean_word_length': 1.831282254863041, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 40, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '487027', 'n_tokens_mistral': 1663, 'n_tokens_neox': 1555, 'n_words': 648}