public CapedwarfLogService() {
    String appId = Application.getAppId();
    store =
        InfinispanUtils.<String, CapedwarfLogElement>getCache(appId, CacheName.LOGS)
            .getAdvancedCache()
            .withFlags(Flag.IGNORE_RETURN_VALUES);
    this.searchManager = Search.getSearchManager(store);

    final Compatibility instance = Compatibility.getRawInstance();
    if (instance != null) {
      logToFile = instance.getValue(Compatibility.Feature.LOG_TO_FILE);
      ignoreLogging = instance.isEnabled(Compatibility.Feature.IGNORE_LOGGING);
      if (instance.isEnabled(Compatibility.Feature.ASYNC_LOGGING)) {
        logWriter = new AsyncLogWriter();
      } else {
        logWriter = new SyncLogWriter();
      }
    } else {
      logToFile = null;
      ignoreLogging = true;
      logWriter = NoopLogWriter.INSTANCE;
    }
  }
Exemplo n.º 2
0
 private GridFilesystem getGridFilesystem() {
   return InfinispanUtils.getGridFilesystem();
 }
 public DatastoreService.KeyRangeState checkRange(KeyRange keyRange, String sequenceName) {
   return InfinispanUtils.submit(
       CacheName.DIST, new KeyRangeCheckTask(keyRange, sequenceName), sequenceName);
 }
 public Long getRange(Key parent, String sequenceName, long num) {
   return InfinispanUtils.submit(
       CacheName.DIST, new KeyGeneratorTask(sequenceName, num), sequenceName);
 }