/** * Initialize a new buffer. * * @param dbBuffer * the underlying database's own buffer. * @param client * connection to the cache service. * @param options * options controlling cache operations. */ public CacheBuffer(WriteBuffer dbBuffer, CacheService client, CacheOptions options) { super(null, options.getWriteBufferSize()); this.dbBuffer = dbBuffer; this.client = client; this.none = Sync.none(); }
/** * Initialize a new buffer. * * @param dbBuffer * the underlying database's own buffer. * @param client * connection to the cache service. * @param options * options controlling cache operations. */ public CacheBuffer(WriteBuffer dbBuffer, CacheService client, CacheOptions options) { super(null, options.getWriteBufferSize()); this.dbBuffer = dbBuffer; this.client = client; this.none = Sync.none(); }
/** * Update properties by setting fields from the configuration. * <p> * If a property is not defined in the configuration, then it is left * unmodified. * * @param rc * configuration to read properties from. * @return {@code this} */ public CacheOptions fromConfig(final Config rc) { setTimeout(Timeout.getTimeout(rc, "cache", "dht", "timeout", getTimeout())); setWriteBufferSize(rc.getInt("cache", "dht", "writeBufferSize", getWriteBufferSize())); return this; } }
/** * Update properties by setting fields from the configuration. * <p> * If a property is not defined in the configuration, then it is left * unmodified. * * @param rc * configuration to read properties from. * @return {@code this} */ public CacheOptions fromConfig(final Config rc) { setTimeout(Timeout.getTimeout(rc, "cache", "dht", "timeout", getTimeout())); setWriteBufferSize(rc.getInt("cache", "dht", "writeBufferSize", getWriteBufferSize())); return this; } }