示例#1
0
 @Override
 protected void init(
     SharedServiceStuff stuff,
     Stores<?, ?> stores,
     ClusterViewByServer cluster,
     AtomicBoolean shutdown) {
   super.init(stuff, stores, cluster, shutdown);
   _fileManager = stuff.getFileManager();
   // let's use max-TTL-plus-one-day
   _maxTimeToLiveMsecs =
       stuff.getServiceConfig().cfgMaxMaxTTL.getMillis() + new TimeSpan("1d").getMillis();
 }
 protected StoreEntryServlet(
     SharedServiceStuff stuff,
     ClusterViewByServer clusterView,
     StoreHandler<K, E, ?> storeHandler,
     boolean handleRouting) {
   // null -> use servlet path base as-is
   super(stuff, clusterView, null);
   _stuff = stuff;
   _storeHandler = storeHandler;
   _jsonWriter = stuff.jsonWriter();
   _keyConverter = stuff.getKeyConverter();
   ServiceConfig serviceConfig = stuff.getServiceConfig();
   if (serviceConfig.metricsEnabled) {
     _getMetrics = OperationMetrics.forEntityOperation(serviceConfig, "entryGet");
     _putMetrics = OperationMetrics.forEntityOperation(serviceConfig, "entryPut");
     _deleteMetrics = OperationMetrics.forNonPayloadOperation(serviceConfig, "entryDelete");
   } else {
     _getMetrics = null;
     _putMetrics = null;
     _deleteMetrics = null;
   }
 }