org.apache.geode.cache.server.ClientSubscriptionConfig Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of geode-core Show documentation
Show all versions of geode-core Show documentation
Apache Geode provides a database-like consistency model, reliable transaction processing and a shared-nothing architecture to maintain very low latency performance with high concurrency processing
/*
* Licensed to the Apache Software Foundation (ASF) under one or more contributor license
* agreements. See the NOTICE file distributed with this work for additional information regarding
* copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License. You may obtain a
* copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package org.apache.geode.cache.server;
/**
* Used to configure queuing on a cache server for client subscriptions.
*
*
* - For eviction-policy none client queue entries are not evicted to disk
*
* - For eviction-policy mem client queue entries are evicted to disk when limit is
* reached, defined by capacity
* - For eviction-policy entry HA entries are evicted to disk when limit is reached,
* defined by capacity
*
*
*
* The capacity limits the total amount of memory or entries for all client queues on held on this
* server. If this server hosts multiple client queues, they will all share the same capacity.
*
*
* Configuration:
*
* The client queue
is configurable declaratively or programmatically. Declarative
* configuration is achieved through defining the configuration parameters in a
* cache.xml
file. Programmatic configuration may be achieved by first instantiating a
* CacheServer
object and get {@link CacheServer#getClientSubscriptionConfig}
* ClientSubscriptionConfig
object and modify each desired parameter and value.
*
*
*
* If you are using a cache.xml
file to create a CacheServer
* declaratively, you can do the following to configure ClientSubscriptionConfig
and to
* have none eviction policy no need to specify client-subscription tag as it is a default
* one.
*
*
*
*
* <cache-server port=4444>
* <client-subscription eviction-policy="entry | mem" capacity=35 overflow-directory="OverflowDir"></client-subscription>
* </cache-server>
*
*
*
* @see #getEvictionPolicy
* @see #getCapacity
*
*
* @since GemFire 5.7
*/
public interface ClientSubscriptionConfig {
/**
* The default limit that is assigned to client subscription.
*/
public static final int DEFAULT_CAPACITY = 1;
/**
* The default eviction policy that is assigned to client subscription.
*/
public static final String DEFAULT_EVICTION_POLICY = "none";
/**
* The default overflow directory that is assigned to client subscription.
*/
public static final String DEFAULT_OVERFLOW_DIRECTORY = ".";
/**
* Returns the capacity of the client queue. will be in MB for eviction-policy mem else
* number of entries
*
* @see #DEFAULT_CAPACITY
* @since GemFire 5.7
*/
public int getCapacity();
/**
* Sets the capacity of the client queue. will be in MB for eviction-policy mem else number
* of entries
*
* @see #DEFAULT_CAPACITY
* @since GemFire 5.7
*/
public void setCapacity(int capacity);
/**
* Returns the eviction policy that is executed when capacity of the client queue is reached.
*
* @see #DEFAULT_EVICTION_POLICY
* @since GemFire 5.7
*/
public String getEvictionPolicy();
/**
* Sets the eviction policy that is executed when capacity of the client queue is reached.
*
* @see #DEFAULT_EVICTION_POLICY
* @since GemFire 5.7
*/
public void setEvictionPolicy(String policy);
/**
* Sets the overflow directory for a client queue
*
* @param overflowDirectory the overflow directory for a client queue's overflowed entries
* @since GemFire 5.7
* @deprecated as of 6.5 use {@link #setDiskStoreName(String)} instead
*/
public void setOverflowDirectory(String overflowDirectory);
/**
* Answers the overflow directory for a client queue's overflowed client queue entries.
*
* @return the overflow directory for a client queue's overflowed entries
* @since GemFire 5.7
* @deprecated as of 6.5 use {@link #getDiskStoreName} instead
*/
public String getOverflowDirectory();
/**
* Sets the disk store name for overflow
*
* @param diskStoreName
* @since GemFire 6.5
*/
public void setDiskStoreName(String diskStoreName);
/**
* get the diskStoreName for overflow
*
* @since GemFire 6.5
*/
public String getDiskStoreName();
}