<commit_before>package swift.deployment

import static swift.deployment.Tools.*

abstract class SwiftBase {
    static boolean ENABLE_YOUR_KIT_PROFILER = false
    static String YOUR_KIT_PROFILER_JAVA_OPTION =  ENABLE_YOUR_KIT_PROFILER ? " -agentpath:yjp/bin/linux-x86-64/libyjpagent.so " : ""
    static String SURROGATE_CMD = "-Xincgc -cp swiftcloud.jar -Djava.util.logging.config.file=logging.properties swift.dc.DCServer"
    static String SEQUENCER_CMD = "-Xincgc -cp swiftcloud.jar -Djava.util.logging.config.file=logging.properties swift.dc.DCSequencerServer"
    static String SHEPARD_CMD = "-cp swiftcloud.jar -Djava.util.logging.config.file=logging.properties sys.herd.Shepard"

    static final DEFAULT_PROPS = [
        'swift.cacheEvictionTimeMillis':'5000000',
        'swift.maxCommitBatchSize':'10',
        'swift.maxAsyncTransactionsQueued':'50',
        'swift.cacheSize':'0',
        'swift.asyncCommit':'false',
        'swift.notifications':'false',
        'swift.cacheUpdateProtocol':'NO_CACHE_OR_UNCOORDINATED',
        'swift.cachePolicy':'CACHED',
        'swift.isolationLevel':'SNAPSHOT_ISOLATION',
        'swift.reports':'APP_OP',
        'swift.notificationPeriodMillis':'1000',
        'swift.pruningIntervalMillis' :'60000',
        'swift.notificationsFakePracti' : 'false',
    ]

    static DC_PROPS_KEYS = [
        'swift.pruningIntervalMillis',
        'swift.notificationsFakePracti',
        'swift.notificationPeriodMillis'
    ]

    static CACHING_NOTIFICATIONS_PROPS = ['swift.cacheSize':'256',
        'swift.asyncCommit':'true',
        'swift.notifications':'true',
        'swift.cacheUpdateProtocol':'CAUSAL_NOTIFICATIONS_STREAM']
    static CACHING_PERIODIC_REFRESH_PROPS = ['swift.cacheSize':'256',
        'swift.asyncCommit':'true',
        'swift.notifications':'false',
        'swift.cacheUpdateProtocol':'CAUSAL_PERIODIC_REFRESH',
        'swift.cacheRefreshPeriodMillis' : '1000']
    static NO_CACHING_NOTIFICATIONS_PROPS = [
        'swift.cacheSize':'0',
        'swift.asyncCommit':'false',
        'swift.notifications':'false',
        'swift.cacheUpdateProtocol':'NO_CACHE_OR_UNCOORDINATED']

    static NO_PRUNING_PROPS = ['swift.pruningIntervalMillis' :'1000000000',
        'swift.deadlineMillis' : '120000']

    static BLOATED_COUNTERS_PROPS = ['swift.bloatedCounters' : 'true']

    static NO_K_STABILITY_PROPS = ['swift.disasterSafe' : 'false']

    static MODES = [
        'refresh-frequent' : (CACHING_PERIODIC_REFRESH_PROPS + ['swift.cacheRefreshPeriodMillis' : '1000']),
        'refresh-frequent-no-pruning': CACHING_PERIODIC_REFRESH_PROPS + [
            'swift.cacheRefreshPeriodMillis' : '1000'] + NO_PRUNING_PROPS,
        // WISHME: this should rather be a workload property than a "mode" hack
        'refresh-frequent-bloated-counter' : (CACHING_PERIODIC_REFRESH_PROPS + ['swift.cacheRefreshPeriodMillis' : '1000'] + BLOATED_COUNTERS_PROPS),
	'refresh-frequent-no-pruning-bloated-counters': (CACHING_PERIODIC_REFRESH_PROPS + ['swift.cacheRefreshPeriodMillis' : '1000'] + BLOATED_COUNTERS_PROPS + NO_PRUNING_PROPS), 
        'refresh-infrequent': (CACHING_PERIODIC_REFRESH_PROPS + ['swift.cacheRefreshPeriodMillis' : '10000']),
        'refresh-infrequent-no-pruning': (CACHING_PERIODIC_REFRESH_PROPS + ['swift.cacheRefreshPeriodMillis' : '10000'] + NO_PRUNING_PROPS),
        'refresh-infrequent-bloated-counters': (CACHING_PERIODIC_REFRESH_PROPS + ['swift.cacheRefreshPeriodMillis' : '10000'] + BLOATED_COUNTERS_PROPS),
        'refresh-infrequent-no-pruning-bloated-counters': (CACHING_PERIODIC_REFRESH_PROPS + ['swift.cacheRefreshPeriodMillis' : '10000'] + BLOATED_COUNTERS_PROPS + NO_PRUNING_PROPS),
        'notifications-veryfrequent': CACHING_NOTIFICATIONS_PROPS  + ['swift.notificationPeriodMillis':'500'],
        'notifications-frequent': CACHING_NOTIFICATIONS_PROPS  + ['swift.notificationPeriodMillis':'1000'],
        'notifications-frequent-no-pruning': CACHING_NOTIFICATIONS_PROPS  + [
            'swift.notificationPeriodMillis':'1000']  + NO_PRUNING_PROPS,
        'notifications-frequent-practi': CACHING_NOTIFICATIONS_PROPS + ['swift.notificationPeriodMillis':'1000', 'swift.notificationsFakePracti':'true', 'swift.notificationsDeltaVectors' : 'true'],
        'notifications-frequent-practi-no-deltas': CACHING_NOTIFICATIONS_PROPS + ['swift.notificationPeriodMillis':'1000', 'swift.notificationsFakePracti':'true', 'swift.notificationsDeltaVectors' : 'false'],
        'notifications-infrequent': CACHING_NOTIFICATIONS_PROPS + ['swift.notificationPeriodMillis':'10000'],
        'notifications-infrequent-practi': CACHING_NOTIFICATIONS_PROPS + ['swift.notificationPeriodMillis':'10000', 'swift.notificationsFakePracti':'true', 'swift.notificationsDeltaVectors' : 'true'],
        'notifications-infrequent-practi-no-deltas': CACHING_NOTIFICATIONS_PROPS + ['swift.notificationPeriodMillis':'10000', 'swift.notificationsFakePracti':'true', 'swift.notificationsDeltaVectors' : 'false'],
        'notifications-infrequent-bloated-counters': (CACHING_NOTIFICATIONS_PROPS + ['swift.notificationPeriodMillis' : '10000'] + BLOATED_COUNTERS_PROPS),
        'no-caching' : NO_CACHING_NOTIFICATIONS_PROPS,
        'no-caching-strict-freshness' : NO_CACHING_NOTIFICATIONS_PROPS + ['swift.cachePolicy' : 'MOST_RECENT'],
        'no-caching-strict-freshness-no-k-stability': NO_CACHING_NOTIFICATIONS_PROPS + ['swift.cachePolicy' : 'MOST_RECENT'] + NO_K_STABILITY_PROPS,<commit_msg>SwiftBase: no-caching-no-pruning option<commit_after>package swift.deployment

import static swift.deployment.Tools.*

abstract class SwiftBase {
    static boolean ENABLE_YOUR_KIT_PROFILER = false
    static String YOUR_KIT_PROFILER_JAVA_OPTION =  ENABLE_YOUR_KIT_PROFILER ? " -agentpath:yjp/bin/linux-x86-64/libyjpagent.so " : ""
    static String SURROGATE_CMD = "-Xincgc -cp swiftcloud.jar -Djava.util.logging.config.file=logging.properties swift.dc.DCServer"
    static String SEQUENCER_CMD = "-Xincgc -cp swiftcloud.jar -Djava.util.logging.config.file=logging.properties swift.dc.DCSequencerServer"
    static String SHEPARD_CMD = "-cp swiftcloud.jar -Djava.util.logging.config.file=logging.properties sys.herd.Shepard"

    static final DEFAULT_PROPS = [
        'swift.cacheEvictionTimeMillis':'5000000',
        'swift.maxCommitBatchSize':'10',
        'swift.maxAsyncTransactionsQueued':'50',
        'swift.cacheSize':'0',
        'swift.asyncCommit':'false',
        'swift.notifications':'false',
        'swift.cacheUpdateProtocol':'NO_CACHE_OR_UNCOORDINATED',
        'swift.cachePolicy':'CACHED',
        'swift.isolationLevel':'SNAPSHOT_ISOLATION',
        'swift.reports':'APP_OP',
        'swift.notificationPeriodMillis':'1000',
        'swift.pruningIntervalMillis' :'60000',
        'swift.notificationsFakePracti' : 'false',
    ]

    static DC_PROPS_KEYS = [
        'swift.pruningIntervalMillis',
        'swift.notificationsFakePracti',
        'swift.notificationPeriodMillis'
    ]

    static CACHING_NOTIFICATIONS_PROPS = ['swift.cacheSize':'256',
        'swift.asyncCommit':'true',
        'swift.notifications':'true',
        'swift.cacheUpdateProtocol':'CAUSAL_NOTIFICATIONS_STREAM']
    static CACHING_PERIODIC_REFRESH_PROPS = ['swift.cacheSize':'256',
        'swift.asyncCommit':'true',
        'swift.notifications':'false',
        'swift.cacheUpdateProtocol':'CAUSAL_PERIODIC_REFRESH',
        'swift.cacheRefreshPeriodMillis' : '1000']
    static NO_CACHING_NOTIFICATIONS_PROPS = [
        'swift.cacheSize':'0',
        'swift.asyncCommit':'false',
        'swift.notifications':'false',
        'swift.cacheUpdateProtocol':'NO_CACHE_OR_UNCOORDINATED']

    static NO_PRUNING_PROPS = ['swift.pruningIntervalMillis' :'1000000000',
        'swift.deadlineMillis' : '120000']

    static BLOATED_COUNTERS_PROPS = ['swift.bloatedCounters' : 'true']

    static NO_K_STABILITY_PROPS = ['swift.disasterSafe' : 'false']

    static MODES = [
        'refresh-frequent' : (CACHING_PERIODIC_REFRESH_PROPS + ['swift.cacheRefreshPeriodMillis' : '1000']),
        'refresh-frequent-no-pruning': CACHING_PERIODIC_REFRESH_PROPS + [
            'swift.cacheRefreshPeriodMillis' : '1000'] + NO_PRUNING_PROPS,
        // WISHME: this should rather be a workload property than a "mode" hack
        'refresh-frequent-bloated-counter' : (CACHING_PERIODIC_REFRESH_PROPS + ['swift.cacheRefreshPeriodMillis' : '1000'] + BLOATED_COUNTERS_PROPS),
	'refresh-frequent-no-pruning-bloated-counters': (CACHING_PERIODIC_REFRESH_PROPS + ['swift.cacheRefreshPeriodMillis' : '1000'] + BLOATED_COUNTERS_PROPS + NO_PRUNING_PROPS), 
        'refresh-infrequent': (CACHING_PERIODIC_REFRESH_PROPS + ['swift.cacheRefreshPeriodMillis' : '10000']),
        'refresh-infrequent-no-pruning': (CACHING_PERIODIC_REFRESH_PROPS + ['swift.cacheRefreshPeriodMillis' : '10000'] + NO_PRUNING_PROPS),
        'refresh-infrequent-bloated-counters': (CACHING_PERIODIC_REFRESH_PROPS + ['swift.cacheRefreshPeriodMillis' : '10000'] + BLOATED_COUNTERS_PROPS),
        'refresh-infrequent-no-pruning-bloated-counters': (CACHING_PERIODIC_REFRESH_PROPS + ['swift.cacheRefreshPeriodMillis' : '10000'] + BLOATED_COUNTERS_PROPS + NO_PRUNING_PROPS),
        'notifications-veryfrequent': CACHING_NOTIFICATIONS_PROPS  + ['swift.notificationPeriodMillis':'500'],
        'notifications-frequent': CACHING_NOTIFICATIONS_PROPS  + ['swift.notificationPeriodMillis':'1000'],
        'notifications-frequent-no-pruning': CACHING_NOTIFICATIONS_PROPS  + [
            'swift.notificationPeriodMillis':'1000']  + NO_PRUNING_PROPS,
        'notifications-frequent-practi': CACHING_NOTIFICATIONS_PROPS + ['swift.notificationPeriodMillis':'1000', 'swift.notificationsFakePracti':'true', 'swift.notificationsDeltaVectors' : 'true'],
        'notifications-frequent-practi-no-deltas': CACHING_NOTIFICATIONS_PROPS + ['swift.notificationPeriodMillis':'1000', 'swift.notificationsFakePracti':'true', 'swift.notificationsDeltaVectors' : 'false'],
        'notifications-infrequent': CACHING_NOTIFICATIONS_PROPS + ['swift.notificationPeriodMillis':'10000'],
        'notifications-infrequent-practi': CACHING_NOTIFICATIONS_PROPS + ['swift.notificationPeriodMillis':'10000', 'swift.notificationsFakePracti':'true', 'swift.notificationsDeltaVectors' : 'true'],
        'notifications-infrequent-practi-no-deltas': CACHING_NOTIFICATIONS_PROPS + ['swift.notificationPeriodMillis':'10000', 'swift.notificationsFakePracti':'true', 'swift.notificationsDeltaVectors' : 'false'],
        'notifications-infrequent-bloated-counters': (CACHING_NOTIFICATIONS_PROPS + ['swift.notificationPeriodMillis' : '10000'] + BLOATED_COUNTERS_PROPS),
        'no-caching' : NO_CACHING_NOTIFICATIONS_PROPS,
        'no-caching-no-pruning' : NO_CACHING_NOTIFICATIONS_PROPS + NO_PRUNING_PROPS,
        'no-caching-strict-freshness' : NO_CACHING_NOTIFICATIONS_PROPS + ['swift.cachePolicy' : 'MOST_RECENT'],
        'no-caching-strict-freshness-no-k-stability': NO_CACHING_NOTIFICATIONS_PROPS + ['swift.cachePolicy' : 'MOST_RECENT'] + NO_K_STABILITY_PROPS,
{'fraction_non_alphanumeric': 0.12837898924147906, 'fraction_numerical': 0.022963565681222313, 'mean_word_length': 4.852910052910053, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2267241', 'n_tokens_mistral': 4115, 'n_tokens_neox': 3795, 'n_words': 412}