All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.gemstone.gemfire.cache.PartitionAttributes Maven / Gradle / Ivy

There is a newer version: 2.0-BETA
Show newest version
/*
 * Copyright (c) 2010-2015 Pivotal Software, Inc. All rights reserved.
 *
 * Licensed 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. See accompanying
 * LICENSE file.
 */

package com.gemstone.gemfire.cache;

import java.util.List;
import java.util.Properties;

import com.gemstone.gemfire.cache.PartitionResolver;
import com.gemstone.gemfire.cache.partition.PartitionListener;

/**
 * 
 * Attributes that define the partitioned character of a Partitioned Region.  
 * This interface allows for the discovery of Partitioned Region attributes using 
 * {@link com.gemstone.gemfire.cache.RegionAttributes#getPartitionAttributes()} as well
 * as the configuration of a Partitioned Region using {@link com.gemstone.gemfire.cache.AttributesFactory#setPartitionAttributes(PartitionAttributes)}.
 * 
 * PartitionAttributes are created using the {@link com.gemstone.gemfire.cache.PartitionAttributesFactory}
 * 
 * The default PartitionAttributes can be determined using {@link com.gemstone.gemfire.cache.PartitionAttributesFactory#create()} with out
 * calling any of its mutator methods e.g.  {@link com.gemstone.gemfire.cache.PartitionAttributesFactory#setLocalMaxMemory(int)}
 *
 * Also see {@link com.gemstone.gemfire.cache.DataPolicy#PARTITION}.
 * 
 * @author rreja
 * @since 5.0
 * 
 */
public interface PartitionAttributes
{
  /**
   * returns entryTimeToLive in ExpirationAttributes.
   * 
   * @return expirationAttributes
   */
  // public ExpirationAttributes getEntryTimeToLive();

  /**
   * returns entryIdleTimeout in ExpirationAttributes.
   * 
   * @return expirationAttributes
   */
  // public ExpirationAttributes getEntryIdleTimeout();

  /**
   * The number of Backups for an entry in PartitionedRegion. This value should
   * be between 0 and 3 (for a total of 1 to 4 instances of the data)
   * 
   * @return redundantCopies.
   */
  public int getRedundantCopies();

  /**
   * This method returns the maximum total size of the region in megabytes.
   * @deprecated use getTotalMaxMemory() instead
   * @return total size in megabytes.
   */
  @Deprecated
  public long getTotalSize();
  
  /**
   * This method returns the maximum total size of the region, in megabytes
   * @return maximum size of the partitioned region, in megabytes
   */
  public long getTotalMaxMemory();

  /**
   * This method returns total number of buckets for a PartitionedRegion.
   * 
   * @return total number of buckets for a PartitionedRegion.
   */
  public int getTotalNumBuckets();  

  /**
   * This method returns the maximum amount of local memory that can be used
   * by the Region.
   */
  public int getLocalMaxMemory();
  
  /**
   * Returns name of the colocated PartitionedRegion's name 
   * @since 6.0
   */
  public String getColocatedWith();

  /**
   * This method returns local properties.  There are currently no local
   * properties defined that are not also deprecated.
   * 
   * @deprecated use {@link #getLocalMaxMemory()} in GemFire 5.1 and later releases
   * @return localProperties
   */
  @Deprecated
  public Properties getLocalProperties();

  /**
   * This method returns global properties.  There are currently no global
   * properties defined that are not also deprecated.
   * 
   * @deprecated use {@link #getTotalMaxMemory()} and {@link #getTotalNumBuckets()} in GemFire 5.1 and later releases
   * @return globalProperties
   */
  @Deprecated
  public Properties getGlobalProperties();

  /**
   * Returns the PartitionResolver set for custom partitioning
   * @return PartitionResolver for the PartitionedRegion
   * @since 6.0
   */
  public PartitionResolver getPartitionResolver();

  /**
   * Returns the delay in milliseconds that
   * existing members will wait before satisfying redundancy
   * after another member crashes.
   * 
   * @since 6.0
   */
  public long getRecoveryDelay();

  /**
   * Returns the delay in milliseconds that a new
   * member will wait before trying to satisfy redundancy
   * of data hosted on other members.
   * 
   * @since 6.0
   */
  public long getStartupRecoveryDelay();
  
  /**
   * Returns array of PartitionListener{s} configured on this partitioned region
   * 
   * @see PartitionListener
   * @return PartitionListener configured on this partitioned region
   * @since 6.5
   */
  public PartitionListener[] getPartitionListeners();

  /**
   * Returns FixedPartitionAttributes's list of local partitions
   * defined on this Partitioned Region
   * 
   * @since 6.6
   */
  public List getFixedPartitionAttributes();
  
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy