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

org.apache.geode.internal.cache.versions.VersionStamp Maven / Gradle / Ivy

Go to download

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

There is a newer version: 1.15.1
Show newest version
/*
 * 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.internal.cache.versions;

import org.apache.geode.cache.EntryEvent;
import org.apache.geode.distributed.DistributedMember;
import org.apache.geode.distributed.internal.membership.InternalDistributedMember;
import org.apache.geode.internal.cache.LocalRegion;

/**
 *
 */
public interface VersionStamp extends VersionHolder {



  /**
   * set the time stamp from the given clock value
   */
  void setVersionTimeStamp(long time);

  // /**
  // * @return the ID of the previous member that last changed the corresponding entry.
  // */
  // DistributedMember getPreviousMemberID();


  /**
   * Sets the version information with what is in the tag
   * 
   * @param tag the entryVersion to set
   */
  void setVersions(VersionTag tag);

  /**
   * @param memberID the memberID to set
   */
  void setMemberID(VersionSource memberID);

  // /**
  // * @param previousMemberID the previousMemberID to set
  // */
  // void setPreviousMemberID(DistributedMember previousMemberID);

  /**
   * returns a VersionTag carrying this stamps information. This is used for transmission of the
   * stamp in initial image transfer
   */
  VersionTag asVersionTag();


  /**
   * Perform a versioning check with the incoming event. Throws a
   * ConcurrentCacheModificationException if there is a problem.
   * 
   * @param event
   */
  public void processVersionTag(EntryEvent event);

  /**
   * Perform a versioning check with the given GII information. Throws a
   * ConcurrentCacheModificationException if there is a problem.
   * 
   * @param r the region being modified
   * @param tag the version info for the modification
   * @param isTombstoneFromGII it's a tombstone
   * @param hasDelta it has delta
   * @param thisVM this cache's DM identifier
   * @param sender the identifier of the member providing the entry
   * @param checkConflicts true if conflict checks should be performed
   */
  public void processVersionTag(LocalRegion r, VersionTag tag, boolean isTombstoneFromGII,
      boolean hasDelta, VersionSource thisVM, InternalDistributedMember sender,
      boolean checkConflicts);

  /**
   * return true if this stamp has valid entry/region version information, false if not
   */
  public boolean hasValidVersion();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy