You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by jb...@apache.org on 2017/02/21 17:40:32 UTC
[19/31] geode-native git commit: GEODE-2476: Replace gfcpp with geode.
http://git-wip-us.apache.org/repos/asf/geode-native/blob/fd58b100/src/cppcache/include/geode/statistics/StatisticDescriptor.hpp
----------------------------------------------------------------------
diff --git a/src/cppcache/include/geode/statistics/StatisticDescriptor.hpp b/src/cppcache/include/geode/statistics/StatisticDescriptor.hpp
new file mode 100644
index 0000000..084dbea
--- /dev/null
+++ b/src/cppcache/include/geode/statistics/StatisticDescriptor.hpp
@@ -0,0 +1,93 @@
+#pragma once
+
+#ifndef GEODE_STATISTICS_STATISTICDESCRIPTOR_H_
+#define GEODE_STATISTICS_STATISTICDESCRIPTOR_H_
+
+/*
+ * 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.
+ */
+
+#include <geode/geode_globals.hpp>
+
+using namespace apache::geode::client;
+
+/** @file
+*/
+
+namespace apache {
+namespace geode {
+namespace statistics {
+
+/**
+ * Describes an individual statistic whose value is updated by an
+ * application and may be archived by Geode. These descriptions are
+ * gathered together in a {@link StatisticsType}.
+ *
+ * <P>
+ * To get an instance of this interface use an instance of
+ * {@link StatisticsFactory}.
+ * <P>
+ * StatisticDescriptors are naturally ordered by their name.
+ *
+ */
+
+class CPPCACHE_EXPORT StatisticDescriptor {
+ public:
+ /**
+ * Returns the id of this statistic in a {@link StatisticsType
+ * }. The id is initialized when its statistics
+ * type is created.
+ */
+ virtual int32 getId() = 0;
+
+ /**
+ * Returns the name of this statistic
+ */
+ virtual const char* getName() = 0;
+
+ /**
+ * Returns a description of this statistic
+ */
+ virtual const char* getDescription() = 0;
+
+ /**
+ * Returns true if this statistic is a counter; false if its a gauge.
+ * Counter statistics have values that always increase.
+ * Gauge statistics have unconstrained values.
+ */
+ virtual int8 isCounter() = 0;
+
+ /**
+ * Returns true if a larger statistic value indicates better performance.
+ */
+ virtual int8 isLargerBetter() = 0;
+
+ /**
+ * Returns the unit in which this statistic is measured
+ */
+ virtual const char* getUnit() = 0;
+
+ /*
+ * Destructor
+ */
+ virtual ~StatisticDescriptor() {}
+
+}; // class
+} // namespace statistics
+} // namespace geode
+} // namespace apache
+
+#endif // GEODE_STATISTICS_STATISTICDESCRIPTOR_H_
http://git-wip-us.apache.org/repos/asf/geode-native/blob/fd58b100/src/cppcache/include/geode/statistics/Statistics.hpp
----------------------------------------------------------------------
diff --git a/src/cppcache/include/geode/statistics/Statistics.hpp b/src/cppcache/include/geode/statistics/Statistics.hpp
new file mode 100644
index 0000000..dcaf9bc
--- /dev/null
+++ b/src/cppcache/include/geode/statistics/Statistics.hpp
@@ -0,0 +1,532 @@
+#pragma once
+
+#ifndef GEODE_STATISTICS_STATISTICS_H_
+#define GEODE_STATISTICS_STATISTICS_H_
+
+/*
+ * 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.
+ */
+
+#include <geode/geode_globals.hpp>
+#include <geode/statistics/StatisticsType.hpp>
+#include <geode/statistics/StatisticDescriptor.hpp>
+
+/** @file
+*/
+
+namespace apache {
+namespace geode {
+namespace statistics {
+/**
+ * An instantiation of an existing <code>StatisticsType</code> object with
+ * methods for
+ * setting, incrementing and getting individual <code>StatisticDescriptor</code>
+ * values.
+ */
+class CPPCACHE_EXPORT Statistics {
+ public:
+ /**
+ * Closes these statistics. After statistics have been closed, they
+ * are no longer archived.
+ * A value access on a closed statistics always results in zero.
+ * A value modification on a closed statistics is ignored.
+ */
+ virtual void close() = 0;
+
+ //////////////////////// accessor Methods ///////////////////////
+
+ /**
+ * Returns the id of the statistic with the given name in this
+ * statistics instance.
+ *
+ * @param name statistic name
+ * @throws IllegalArgumentException
+ * No statistic named <code>name</code> exists in this
+ * statistics instance.
+ *
+ * @see StatisticsType#nameToDescriptor
+ */
+ virtual int32 nameToId(const char* name) = 0;
+
+ /**
+ * Returns the descriptor of the statistic with the given name in this
+ * statistics instance.
+ *
+ * @param name statistic name
+ * @throws IllegalArgumentException
+ * No statistic named <code>name</code> exists in this
+ * statistics instance.
+ *
+ * @see StatisticsType#nameToId
+ */
+ virtual StatisticDescriptor* nameToDescriptor(const char* name) = 0;
+
+ /**
+ * Gets a value that uniquely identifies this statistics.
+ */
+ virtual int64 getUniqueId() = 0;
+
+ /**
+ * Gets the {@link StatisticsType} of this instance.
+ */
+ virtual StatisticsType* getType() = 0;
+ /**
+ * Gets the text associated with this instance that helps identify it.
+ */
+ virtual const char* getTextId() = 0;
+ /**
+ * Gets the number associated with this instance that helps identify it.
+ */
+
+ virtual int64 getNumericId() = 0;
+ /**
+ * Returns true if modifications are atomic. This means that multiple threads
+ * can safely modify this instance without additional synchronization.
+ * <p>
+ * Returns false if modifications are not atomic. This means that
+ * modifications
+ * to this instance are cheaper but not thread safe.
+ * <P>
+ * Note that all instances that are {@link #isShared shared} are also atomic.
+ */
+ virtual bool isAtomic() = 0;
+ /**
+ * Returns true if the data for this instance is stored in shared memory.
+ * Returns false if the data is store in local memory.
+ * <P>
+ * Note that all instances that are {@link #isShared shared} are also atomic.
+ */
+ virtual bool isShared() = 0;
+ /**
+ * Returns true if the instance has been {@link #close closed}.
+ */
+ virtual bool isClosed() = 0;
+
+ //////////////////////// set() Methods ///////////////////////
+
+ /**
+ * Sets the value of a statistic with the given <code>id</code>
+ * whose type is <code>int</code>.
+ * @param id a statistic id obtained with {@link #nameToId}
+ * or {@link StatisticsType#nameToId}.
+ * @param value value to set
+ *
+ * @throws IllegalArgumentException
+ * If the id is invalid.
+ */
+ virtual void setInt(int32 id, int32 value) = 0;
+
+ /**
+ * Sets the value of a named statistic of type <code>int</code>
+ *
+ * @param name statistic name
+ * @param value value to set
+ * @throws IllegalArgumentException
+ * If no statistic exists named <code>name</code> or
+ * if the statistic with name <code>name</code> is not of
+ * type <code>int</code>.
+ */
+ virtual void setInt(char* name, int32 value) = 0;
+
+ /**
+ * Sets the value of a described statistic of type <code>int</code>
+ *
+ * @param descriptor a statistic descriptor obtained with {@link
+ * #nameToDescriptor}
+ * or {@link StatisticsType#nameToDescriptor}.
+ * @param value value to set
+ * @throws IllegalArgumentException
+ * If no statistic exists for the given <code>descriptor</code> or
+ * if the described statistic is not of
+ * type <code>int</code>.
+ */
+ virtual void setInt(StatisticDescriptor* descriptor, int32 value) = 0;
+
+ /**
+ * Sets the value of a statistic with the given <code>id</code>
+ * whose type is <code>long</code>.
+ * @param id a statistic id obtained with {@link #nameToId}
+ * or {@link StatisticsType#nameToId}.
+ * @param value value to set
+ *
+ * @throws IllegalArgumentException
+ * If the id is invalid.
+ */
+
+ virtual void setLong(int32 id, int64 value) = 0;
+ /**
+ * Sets the value of a described statistic of type <code>long</code>
+ *
+ * @param descriptor a statistic descriptor obtained with {@link
+ * #nameToDescriptor}
+ * or {@link StatisticsType#nameToDescriptor}.
+ * @param value value to set
+ * @throws IllegalArgumentException
+ * If no statistic exists for the given <code>descriptor</code> or
+ * if the described statistic is not of
+ * type <code>long</code>.
+ */
+ virtual void setLong(StatisticDescriptor* descriptor, int64 value) = 0;
+
+ /**
+ * Sets the value of a named statistic of type <code>long</code>.
+ *
+ * @param name statistic name
+ * @param value value to set
+ * @throws IllegalArgumentException
+ * If no statistic exists named <code>name</code> or
+ * if the statistic with name <code>name</code> is not of
+ * type <code>long</code>.
+ */
+ virtual void setLong(char* name, int64 value) = 0;
+
+ /**
+ * Sets the value of a statistic with the given <code>id</code>
+ * whose type is <code>double</code>.
+ * @param id a statistic id obtained with {@link #nameToId}
+ * or {@link StatisticsType#nameToId}.
+ * @param value value to set
+ *
+ * @throws IllegalArgumentException
+ * If the id is invalid.
+ */
+ virtual void setDouble(int32 id, double value) = 0;
+
+ /**
+ * Sets the value of a described statistic of type <code>double</code>
+ *
+ * @param descriptor a statistic descriptor obtained with {@link
+ * #nameToDescriptor}
+ * or {@link StatisticsType#nameToDescriptor}.
+ * @param value value to set
+ * @throws IllegalArgumentException
+ * If no statistic exists for the given <code>descriptor</code> or
+ * if the described statistic is not of
+ * type <code>double</code>.
+ */
+ virtual void setDouble(
+ apache::geode::statistics::StatisticDescriptor* descriptor,
+ double value) = 0;
+ /**
+ * Sets the value of a named statistic of type <code>double</code>.
+ *
+ * @param name statistic name
+ * @param value value to set
+ * @throws IllegalArgumentException
+ * If no statistic exists named <code>name</code> or
+ * if the statistic with name <code>name</code> is not of
+ * type <code>double</code>.
+ */
+ virtual void setDouble(char* name, double value) = 0;
+
+ /////////////////////// get() Methods ///////////////////////
+
+ /**
+ * Returns the value of the identified statistic of type <code>int</code>.
+ *
+ * @param id a statistic id obtained with {@link #nameToId}
+ * or {@link StatisticsType#nameToId}.
+ * @throws IllegalArgumentException
+ * If the id is invalid.
+ */
+ virtual int32 getInt(int32 id) = 0;
+
+ /**
+ * Returns the value of the described statistic of type <code>int</code>.
+ *
+ * @param descriptor a statistic descriptor obtained with {@link
+ * #nameToDescriptor}
+ * or {@link StatisticsType#nameToDescriptor}.
+ * @throws IllegalArgumentException
+ * If no statistic exists with the specified <code>descriptor</code>
+ * or
+ * if the described statistic is not of
+ * type <code>int</code>.
+ */
+ virtual int32 getInt(
+ apache::geode::statistics::StatisticDescriptor* descriptor) = 0;
+ /**
+ * Returns the value of the statistic of type <code>int</code> at
+ * the given name.
+ * @param name statistic name
+ *
+ * @throws IllegalArgumentException
+ * If no statistic exists with name <code>name</code> or
+ * if the statistic named <code>name</code> is not of
+ * type <code>int</code>.
+ */
+ virtual int32 getInt(char* name) = 0;
+
+ /**
+ * Returns the value of the identified statistic of type <code>long</code>.
+ *
+ * @param id a statistic id obtained with {@link #nameToId}
+ * or {@link StatisticsType#nameToId}.
+ * @throws IllegalArgumentException
+ * If the id is invalid.
+ */
+ virtual int64 getLong(int32 id) = 0;
+
+ /**
+ * Returns the value of the described statistic of type <code>long</code>.
+ *
+ * @param descriptor a statistic descriptor obtained with {@link
+ * #nameToDescriptor}
+ * or {@link StatisticsType#nameToDescriptor}.
+ * @throws IllegalArgumentException
+ * If no statistic exists with the specified <code>descriptor</code>
+ * or
+ * if the described statistic is not of
+ * type <code>long</code>.
+ */
+ virtual int64 getLong(StatisticDescriptor* descriptor) = 0;
+ /**
+ * Returns the value of the statistic of type <code>long</code> at
+ * the given name.
+ *
+ * @param name statistic name
+ * @throws IllegalArgumentException
+ * If no statistic exists with name <code>name</code> or
+ * if the statistic named <code>name</code> is not of
+ * type <code>long</code>.
+ */
+ virtual int64 getLong(char* name) = 0;
+
+ /**
+ * Returns the value of the identified statistic of type <code>double</code>.
+ *
+ * @param id a statistic id obtained with {@link #nameToId}
+ * or {@link StatisticsType#nameToId}.
+ * @throws IllegalArgumentException
+ * If the id is invalid.
+ */
+ virtual double getDouble(int32 id) = 0;
+
+ /**
+ * Returns the value of the described statistic of type <code>double</code>.
+ *
+ * @param descriptor a statistic descriptor obtained with {@link
+ * #nameToDescriptor}
+ * or {@link StatisticsType#nameToDescriptor}.
+ * @throws IllegalArgumentException
+ * If no statistic exists with the specified <code>descriptor</code>
+ * or
+ * if the described statistic is not of
+ * type <code>double</code>.
+ */
+ virtual double getDouble(StatisticDescriptor* descriptor) = 0;
+ /**
+ * Returns the value of the statistic of type <code>double</code> at
+ * the given name.
+ * @param name statistic name
+ *
+ * @throws IllegalArgumentException
+ * If no statistic exists with name <code>name</code> or
+ * if the statistic named <code>name</code> is not of
+ * type <code>double</code>.
+ */
+ virtual double getDouble(char* name) = 0;
+
+ /**
+ * Returns the value of the identified statistic.
+ *
+ * @param descriptor a statistic descriptor obtained with {@link
+ * #nameToDescriptor}
+ * or {@link StatisticsType#nameToDescriptor}.
+ * @throws IllegalArgumentException
+ * If the described statistic does not exist
+ */
+ // virtual Number get(StatisticDescriptor* descriptor)=0;
+
+ /**
+ * Returns the value of the named statistic.
+ *
+ * @throws IllegalArgumentException
+ * If the named statistic does not exist
+ */
+ // virtual Number get(char* name)=0;
+
+ /**
+ * Returns the bits that represent the raw value of the described statistic.
+ *
+ * @param descriptor a statistic descriptor obtained with {@link
+ * #nameToDescriptor}
+ * or {@link StatisticsType#nameToDescriptor}.
+ * @throws IllegalArgumentException
+ * If the described statistic does not exist
+ */
+ virtual int64 getRawBits(StatisticDescriptor* descriptor) = 0;
+
+ /**
+ * Returns the bits that represent the raw value of the named statistic.
+ *
+ * @throws IllegalArgumentException
+ * If the named statistic does not exist
+ */
+ // virtual double getRawBits(char* name)=0;
+
+ //////////////////////// inc() Methods ////////////////////////
+
+ /**
+ * Increments the value of the identified statistic of type <code>int</code>
+ * by the given amount.
+ *
+ * @param id a statistic id obtained with {@link #nameToId}
+ * or {@link StatisticsType#nameToId}.
+ * @param delta change value to be added
+ *
+ * @return The value of the statistic after it has been incremented
+ *
+ * @throws IllegalArgumentException
+ * If the id is invalid.
+ */
+ virtual int32 incInt(int32 id, int32 delta) = 0;
+
+ /**
+ * Increments the value of the described statistic of type <code>int</code>
+ * by the given amount.
+ * @param descriptor a statistic descriptor obtained with {@link
+ * #nameToDescriptor}
+ * or {@link StatisticsType#nameToDescriptor}.
+ * @param delta change value to be added
+ * @return The value of the statistic after it has been incremented
+ *
+ * @throws IllegalArgumentException
+ * If no statistic exists with the given <code>descriptor</code> or
+ * if the described statistic is not of
+ * type <code>int</code>.
+ */
+ virtual int32 incInt(StatisticDescriptor* descriptor, int32 delta) = 0;
+
+ /**
+ * Increments the value of the statistic of type <code>int</code> with
+ * the given name by a given amount.
+ * @param name statistic name
+ * @param delta change value to be added
+ * @return The value of the statistic after it has been incremented
+ *
+ * @throws IllegalArgumentException
+ * If no statistic exists with name <code>name</code> or
+ * if the statistic named <code>name</code> is not of
+ * type <code>int</code>.
+ */
+ virtual int32 incInt(char* name, int32 delta) = 0;
+
+ /**
+ * Increments the value of the identified statistic of type <code>long</code>
+ * by the given amount.
+ *
+ * @param id a statistic id obtained with {@link #nameToId}
+ * or {@link StatisticsType#nameToId}.
+ * @param delta change value to be added
+ *
+ * @return The value of the statistic after it has been incremented
+ *
+ * @throws IllegalArgumentException
+ * If the id is invalid.
+ */
+ virtual int64 incLong(int32 id, int64 delta) = 0;
+
+ /**
+ * Increments the value of the described statistic of type <code>long</code>
+ * by the given amount.
+ *
+ * @param descriptor a statistic descriptor obtained with {@link
+ * #nameToDescriptor}
+ * or {@link StatisticsType#nameToDescriptor}.
+ * @param delta change value to be added
+ * @return The value of the statistic after it has been incremented
+ *
+ * @throws IllegalArgumentException
+ * If no statistic exists with the given <code>descriptor</code> or
+ * if the described statistic is not of
+ * type <code>long</code>.
+ */
+ virtual int64 incLong(StatisticDescriptor* descriptor, int64 delta) = 0;
+ /**
+ * Increments the value of the statistic of type <code>long</code> with
+ * the given name by a given amount.
+ *
+ * @param name statistic name
+ * @param delta change value to be added
+ * @return The value of the statistic after it has been incremented
+ *
+ * @throws IllegalArgumentException
+ * If no statistic exists with name <code>name</code> or
+ * if the statistic named <code>name</code> is not of
+ * type <code>long</code>.
+ */
+ virtual int64 incLong(char* name, int64 delta) = 0;
+
+ /**
+ * Increments the value of the identified statistic of type
+ * <code>double</code>
+ * by the given amount.
+ *
+ * @param id a statistic id obtained with {@link #nameToId}
+ * or {@link StatisticsType#nameToId}.
+ * @param delta change value to be added
+ *
+ * @return The value of the statistic after it has been incremented
+ *
+ * @throws IllegalArgumentException
+ * If the id is invalid.
+ */
+ virtual double incDouble(int32 id, double delta) = 0;
+
+ /**
+ * Increments the value of the described statistic of type <code>double</code>
+ * by the given amount.
+ * @param descriptor a statistic descriptor obtained with {@link
+ * #nameToDescriptor}
+ * or {@link StatisticsType#nameToDescriptor}.
+ * @param delta change value to be added
+ *
+ * @return The value of the statistic after it has been incremented
+ *
+ * @throws IllegalArgumentException
+ * If no statistic exists with the given <code>descriptor</code> or
+ * if the described statistic is not of
+ * type <code>double</code>.
+ */
+ virtual double incDouble(StatisticDescriptor* descriptor, double delta) = 0;
+ /**
+ * Increments the value of the statistic of type <code>double</code> with
+ * the given name by a given amount.
+ * @param name statistic name
+ * @param delta change value to be added
+ *
+ * @return The value of the statistic after it has been incremented
+ *
+ * @throws IllegalArgumentException
+ * If no statistic exists with name <code>name</code> or
+ * if the statistic named <code>name</code> is not of
+ * type <code>double</code>.
+ */
+ virtual double incDouble(char* name, double delta) = 0;
+
+ protected:
+ /**
+ * Destructor is protected to prevent direct deletion. Use close().
+ */
+ virtual ~Statistics() = 0;
+}; // class
+
+} // namespace statistics
+} // namespace geode
+} // namespace apache
+
+#endif // GEODE_STATISTICS_STATISTICS_H_
http://git-wip-us.apache.org/repos/asf/geode-native/blob/fd58b100/src/cppcache/include/geode/statistics/StatisticsFactory.hpp
----------------------------------------------------------------------
diff --git a/src/cppcache/include/geode/statistics/StatisticsFactory.hpp b/src/cppcache/include/geode/statistics/StatisticsFactory.hpp
new file mode 100644
index 0000000..8445a62
--- /dev/null
+++ b/src/cppcache/include/geode/statistics/StatisticsFactory.hpp
@@ -0,0 +1,223 @@
+#pragma once
+
+#ifndef GEODE_STATISTICS_STATISTICSFACTORY_H_
+#define GEODE_STATISTICS_STATISTICSFACTORY_H_
+
+/*
+ * 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.
+ */
+#include <geode/geode_globals.hpp>
+#include <geode/statistics/StatisticDescriptor.hpp>
+#include <geode/statistics/StatisticsType.hpp>
+#include "../ExceptionTypes.hpp"
+#include <geode/statistics/Statistics.hpp>
+
+/** @file
+*/
+
+namespace apache {
+namespace geode {
+namespace statistics {
+
+/**
+ * Instances of this interface provide methods that create instances
+ * of {@link StatisticDescriptor} and {@link StatisticsType}.
+ * Every {@link StatisticsFactory} is also a type factory.
+ *
+ * <P>
+ *
+ * A <code>StatisticsFactory</code> can create a {@link
+ * StatisticDescriptor statistic} of three numeric types:
+ * <code>int</code>, <code>long</code>, and <code>double</code>. A
+ * statistic (<code>StatisticDescriptor</code>) can either be a
+ * <I>gauge</I> meaning that its value can increase and decrease or a
+ * <I>counter</I> meaning that its value is strictly increasing.
+ * Marking a statistic as a counter allows the Geode Manager Console
+ * to properly display a statistics whose value "wraps around" (that
+ * is, exceeds its maximum value).
+ *
+ */
+
+class CPPCACHE_EXPORT StatisticsFactory {
+ protected:
+ StatisticsFactory() {}
+ StatisticsFactory(const StatisticsFactory&) {}
+
+ public:
+ /**
+ * Return a pre-existing statistics factory. Typically configured through
+ * creation of a distributed system.
+ */
+ static StatisticsFactory* getExistingInstance();
+
+ virtual ~StatisticsFactory() {}
+
+ /**
+ * Creates and returns a long counter {@link StatisticDescriptor}
+ * with the given <code>name</code>, <code>description</code>,
+ * <code>units</code>,and with larger values indicating better performance.
+ */
+
+ virtual StatisticDescriptor* createIntCounter(const char* name,
+ const char* description,
+ const char* units,
+ int8 largerBetter = true) = 0;
+
+ /**
+ * Creates and returns a double counter {@link StatisticDescriptor}
+ * with the given <code>name</code>, <code>description</code>,
+ *<code>units</code>, and with larger values indicating better performance.
+ */
+
+ virtual StatisticDescriptor* createLongCounter(const char* name,
+ const char* description,
+ const char* units,
+ int8 largerBetter = true) = 0;
+
+ /**
+ * Creates and returns an int gauge {@link StatisticDescriptor}
+ * with the given <code>name</code>, <code>description</code>,
+ * <code>units</code>, and with smaller values indicating better
+ * performance.
+ */
+
+ virtual StatisticDescriptor* createDoubleCounter(
+ const char* name, const char* description, const char* units,
+ int8 largerBetter = true) = 0;
+
+ /**
+ * Creates and returns an int gauge {@link StatisticDescriptor}
+ * with the given <code>name</code>, <code>description</code>,
+ * <code>units</code>, and with smaller values indicating better performance.
+ */
+ virtual StatisticDescriptor* createIntGauge(const char* name,
+ const char* description,
+ const char* units,
+ int8 largerBetter = false) = 0;
+
+ /**
+ * Creates and returns an long gauge {@link StatisticDescriptor}
+ * with the given <code>name</code>, <code>description</code>,
+ * <code>units</code>, and with smaller values indicating better performance.
+ */
+ virtual StatisticDescriptor* createLongGauge(const char* name,
+ const char* description,
+ const char* units,
+ int8 largerBetter = false) = 0;
+
+ /**
+ * Creates and returns an double gauge {@link StatisticDescriptor}
+ * with the given <code>name</code>, <code>description</code>,
+ * <code>units</code>, and with smaller values indicating better performance.
+ */
+ virtual StatisticDescriptor* createDoubleGauge(const char* name,
+ const char* description,
+ const char* units,
+ int8 largerBetter = false) = 0;
+
+ /**
+ * Creates and returns a {@link StatisticsType}
+ * with the given <code>name</code>, <code>description</code>,
+ * and {@link StatisticDescriptor}.
+ * @throws IllegalArgumentException
+ * if a type with the given <code>name</code> already exists.
+ */
+ virtual StatisticsType* createType(const char* name, const char* description,
+ StatisticDescriptor** stats,
+ int32 statsLength) = 0;
+
+ /**
+ * Finds and returns an already created {@link StatisticsType}
+ * with the given <code>name</code>.
+ * Returns <code>null</code> if the type does not exist.
+ */
+ virtual StatisticsType* findType(const char* name) = 0;
+
+ /**
+ * Creates and returns a {@link Statistics} instance of the given {@link
+ * StatisticsType type} with default ids.
+ * <p>
+ * The created instance may not be {@link Statistics#isAtomic atomic}.
+ */
+ virtual Statistics* createStatistics(StatisticsType* type) = 0;
+
+ /**
+ * Creates and returns a {@link Statistics} instance of the given {@link
+ * StatisticsType type}, <code>textId</code>, and with a default numeric id.
+ * <p>
+ * The created instance may not be {@link Statistics#isAtomic atomic}.
+ */
+ virtual Statistics* createStatistics(StatisticsType* type,
+ const char* textId) = 0;
+
+ /**
+ * Creates and returns a {@link Statistics} instance of the given {@link
+ * StatisticsType type}, <code>textId</code>, and <code>numericId</code>.
+ * <p>
+ * The created instance may not be {@link Statistics#isAtomic atomic}.
+ */
+ virtual Statistics* createStatistics(StatisticsType* type, const char* textId,
+ int64 numericId) = 0;
+
+ /**
+ * Creates and returns a {@link Statistics} instance of the given {@link
+ * StatisticsType type} with default ids.
+ * <p>
+ * The created instance will be {@link Statistics#isAtomic atomic}.
+ */
+ virtual Statistics* createAtomicStatistics(StatisticsType* type) = 0;
+
+ /**
+ * Creates and returns a {@link Statistics} instance of the given {@link
+ * StatisticsType type}, <code>textId</code>, and with a default numeric id.
+ * <p>
+ * The created instance will be {@link Statistics#isAtomic atomic}.
+ */
+ virtual Statistics* createAtomicStatistics(StatisticsType* type,
+ const char* textId) = 0;
+
+ /**
+ * Creates and returns a {@link Statistics} instance of the given {@link
+ * StatisticsType type}, <code>textId</code>, and <code>numericId</code>.
+ * <p>
+ * The created instance will be {@link Statistics#isAtomic atomic}.
+ */
+ virtual Statistics* createAtomicStatistics(StatisticsType* type,
+ const char* textId,
+ int64 numericId) = 0;
+
+ /** Return the first instance that matches the type, or NULL */
+ virtual Statistics* findFirstStatisticsByType(StatisticsType* type) = 0;
+
+ /**
+ * Returns a name that can be used to identify the manager
+ */
+ virtual const char* getName() = 0;
+
+ /**
+ * Returns a numeric id that can be used to identify the manager
+ */
+ virtual int64 getId() = 0;
+
+ private:
+ const StatisticsFactory& operator=(const StatisticsFactory&);
+
+}; // class
+} // namespace statistics
+} // namespace geode
+} // namespace apache
+
+#endif // GEODE_STATISTICS_STATISTICSFACTORY_H_
http://git-wip-us.apache.org/repos/asf/geode-native/blob/fd58b100/src/cppcache/include/geode/statistics/StatisticsType.hpp
----------------------------------------------------------------------
diff --git a/src/cppcache/include/geode/statistics/StatisticsType.hpp b/src/cppcache/include/geode/statistics/StatisticsType.hpp
new file mode 100644
index 0000000..1d2be00
--- /dev/null
+++ b/src/cppcache/include/geode/statistics/StatisticsType.hpp
@@ -0,0 +1,99 @@
+#pragma once
+
+#ifndef GEODE_STATISTICS_STATISTICSTYPE_H_
+#define GEODE_STATISTICS_STATISTICSTYPE_H_
+
+/*
+ * 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.
+ */
+#include <geode/geode_globals.hpp>
+#include <geode/statistics/StatisticDescriptor.hpp>
+
+using namespace apache::geode::client;
+
+/** @file
+*/
+
+namespace apache {
+namespace geode {
+namespace statistics {
+
+/**
+ * Used to describe a logical collection of StatisticDescriptors. These
+ * descriptions
+ * are used to create an instance of {@link Statistics}.
+ *
+ * <P>
+ * To get an instance of this interface use an instance of
+ * {@link StatisticsFactory}.
+ *
+ */
+
+class CPPCACHE_EXPORT StatisticsType {
+ public:
+ /**
+ * Returns the name of this statistics type.
+ */
+ virtual const char* getName() = 0;
+
+ /**
+ * Returns a description of this statistics type.
+ */
+ virtual const char* getDescription() = 0;
+
+ /**
+ * Returns descriptions of the statistics that this statistics type
+ * gathers together.
+ */
+ virtual StatisticDescriptor** getStatistics() = 0;
+
+ /**
+ * Returns the id of the statistic with the given name in this
+ * statistics instance.
+ *
+ * @throws IllegalArgumentException
+ * No statistic named <code>name</code> exists in this
+ * statistics instance.
+ */
+ virtual int32 nameToId(const char* name) = 0;
+ /**
+ * Returns the descriptor of the statistic with the given name in this
+ * statistics instance.
+ *
+ * @throws IllegalArgumentException
+ * No statistic named <code>name</code> exists in this
+ * statistics instance.
+ */
+ virtual StatisticDescriptor* nameToDescriptor(const char* name) = 0;
+
+ /**
+ * Returns the total number of statistics descriptors in the type.
+ */
+ virtual int32 getDescriptorsCount() = 0;
+
+ // protected:
+ /**
+ * Destructor
+ */
+ virtual ~StatisticsType() {}
+
+}; // class
+
+} // namespace statistics
+} // namespace geode
+} // namespace apache
+
+#endif // GEODE_STATISTICS_STATISTICSTYPE_H_
http://git-wip-us.apache.org/repos/asf/geode-native/blob/fd58b100/src/cppcache/include/gfcpp/Assert.hpp
----------------------------------------------------------------------
diff --git a/src/cppcache/include/gfcpp/Assert.hpp b/src/cppcache/include/gfcpp/Assert.hpp
deleted file mode 100644
index a589ba8..0000000
--- a/src/cppcache/include/gfcpp/Assert.hpp
+++ /dev/null
@@ -1,100 +0,0 @@
-#pragma once
-
-#ifndef GEODE_GFCPP_ASSERT_H_
-#define GEODE_GFCPP_ASSERT_H_
-
-/*
- * 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.
- */
-
-#include "gfcpp_globals.hpp"
-
-/**
- * @file
- *
- * Assertion functions for debugging
- */
-
-namespace apache {
-namespace geode {
-namespace client {
-
-/**
- * @class Assert Assert.hpp
- *
- * Declares debugging assertion reporting functions.
- */
-class CPPCACHE_EXPORT Assert {
- public:
- /** If the given expression is true, does nothing, otherwise calls
- * @ref throwAssertion .
- */
- inline static void assertTrue(bool expression, const char* expressionText,
- const char* file, int line) {
- if (!expression) {
- throwAssertion(expressionText, file, line);
- }
- }
-
- /** Throws the given assertion.
- */
- static void throwAssertion(const char* expressionText, const char* file,
- int line);
-};
-} // namespace client
-} // namespace geode
-} // namespace apache
-
-/** Throws the given assertion. */
-#define GF_R_ASSERT(x) \
- apache::geode::client::Assert::assertTrue(x, #x, __FILE__, __LINE__)
-
-#ifndef GF_DEBUG_ASSERTS
-/** Change this to 1 to use assertion functions. */
-#define GF_DEBUG_ASSERTS 0
-#endif
-
-#ifndef GF_DEVEL_ASSERTS
-#define GF_DEVEL_ASSERTS 0
-#endif
-
-#if GF_DEVEL_ASSERTS == 1
-#undef GF_DEBUG_ASSERTS
-#define GF_DEBUG_ASSERTS 1
-#endif
-
-#if GF_DEBUG_ASSERTS == 1
-#undef GF_DEVEL_ASSERTS
-#define GF_DEVEL_ASSERTS 1
-#endif
-
-/** Throws the given assertion if GF_DEBUG_ASSERTS is true. */
-#if GF_DEBUG_ASSERTS == 1
-#define GF_D_ASSERT(x) \
- apache::geode::client::Assert::assertTrue(x, #x, __FILE__, __LINE__)
-#else
-#define GF_D_ASSERT(x)
-#endif
-
-/** Throws the given assertion if GF_DEVEL_ASSERTS is true. */
-#if GF_DEVEL_ASSERTS == 1
-#define GF_DEV_ASSERT(x) \
- apache::geode::client::Assert::assertTrue(x, #x, __FILE__, __LINE__)
-#else
-#define GF_DEV_ASSERT(x)
-#endif
-
-#endif // GEODE_GFCPP_ASSERT_H_
http://git-wip-us.apache.org/repos/asf/geode-native/blob/fd58b100/src/cppcache/include/gfcpp/AttributesFactory.hpp
----------------------------------------------------------------------
diff --git a/src/cppcache/include/gfcpp/AttributesFactory.hpp b/src/cppcache/include/gfcpp/AttributesFactory.hpp
deleted file mode 100644
index 93ddd59..0000000
--- a/src/cppcache/include/gfcpp/AttributesFactory.hpp
+++ /dev/null
@@ -1,382 +0,0 @@
-#pragma once
-
-#ifndef GEODE_GFCPP_ATTRIBUTESFACTORY_H_
-#define GEODE_GFCPP_ATTRIBUTESFACTORY_H_
-
-/*
- * 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.
- */
-
-#include "gfcpp_globals.hpp"
-#include "gf_types.hpp"
-#include "ExceptionTypes.hpp"
-#include "ExpirationAction.hpp"
-#include "CacheLoader.hpp"
-#include "CacheWriter.hpp"
-#include "CacheListener.hpp"
-#include "PartitionResolver.hpp"
-#include "RegionAttributes.hpp"
-#include "DiskPolicyType.hpp"
-#include "Pool.hpp"
-
-/**
- * @file
- */
-
-namespace apache {
-namespace geode {
-namespace client {
-
-/** Creates instances of {@link RegionAttributes}. An
- * <code>AttributesFactory</code>
- * instance maintains state for creating <code>RegionAttributes</code>
- * instances.
- * The setter methods are used to change the settings that will be used for
- * creating the next attributes instance with the {@link
- * #createRegionAttributes}
- * method. If you create a factory with the default constructor, then the
- * factory is set up to create attributes with all default settings. You can
- * also create a factory by providing a <code>RegionAttributes</code>, which
- * will set up the new factory with the settings provided in that attributes
- * instance.
- *
- * <p>Once a <code>RegionAttributes</code> is created, it can only be modified
- * after it has been used to create a <code>Region</code>, and then only by
- * using an {@link AttributesMutator} obtained from the region.
- *
- * <h3>Attributes</h3>
- * <h4>Callbacks</h4>
- * <dl>
- * <dt>{@link CacheLoader} [<em>default:</em> NULLPTR]</dt>
- * <dd>User-implemented plug-in for loading data on cache misses.<br>
- * {@link #setCacheLoader} {@link RegionAttributes#getCacheLoader}
- * {@link AttributesMutator#setCacheLoader}</dd>
- *
- * <dt>{@link CacheWriter} [<em>default:</em> NULLPTR]</dt>
- * <dd>User-implemented plug-in for intercepting cache modifications, e.g.
- * for writing to an external data source.<br>
- * {@link #setCacheWriter} {@link RegionAttributes#getCacheWriter}
- * {@link AttributesMutator#setCacheWriter}</dd>
- *
- * <dt>{@link CacheListener} [<em>default:</em> NULLPTR]</dt>
- * <dd>User-implemented plug-in for receiving and handling cache related
- * events.<br>
- * {@link #setCacheListener} {@link RegionAttributes#getCacheListener}
- * {@link AttributesMutator#setCacheListener}</dd>
- * </dl>
- * <h4>Expiration</h4>
- * <dl>
- * <dt>RegionTimeToLive [<em>default:</em> no expiration]</dt>
- * <dd>Expiration configuration for the entire region based on the
- * {@link CacheStatistics#getLastModifiedTime lastModifiedTime}.<br>
- * {@link #setRegionTimeToLive} {@link
- * RegionAttributes#getRegionTimeToLive}
- * {@link AttributesMutator#setRegionTimeToLive}</dd>
- *
- * <dt>RegionIdleTimeout [<em>default:</em> no expiration]</dt>
- * <dd>Expiration configuration for the entire region based on the
- * {@link CacheStatistics#getLastAccessedTime lastAccessedTime}.<br>
- * {@link #setRegionIdleTimeout} {@link
- * RegionAttributes#getRegionIdleTimeout}
- * {@link AttributesMutator#setRegionIdleTimeout}</dd>
- *
- * <dt>EntryTimeToLive [<em>default:</em> no expiration]</dt>
- * <dd>Expiration configuration for individual entries based on the
- * {@link CacheStatistics#getLastModifiedTime lastModifiedTime}.<br>
- * {@link #setEntryTimeToLive} {@link
- * RegionAttributes#getEntryTimeToLive}
- * {@link AttributesMutator#setEntryTimeToLive}</dd>
- *
- * <dt>EntryIdleTimeout [<em>default:</em> no expiration]</dt>
- * <dd>Expiration configuration for individual entries based on the
- * {@link CacheStatistics#getLastAccessedTime lastAccessedTime}.<br>
- * {@link #setEntryIdleTimeout} {@link
- * RegionAttributes#getEntryIdleTimeout}
- * {@link AttributesMutator#setEntryIdleTimeout}</dd>
- * </dl>
- * <h4>Storage</h4>
- * <dl>
- *
- * <dt>InitialCapacity [<em>default:</em> <code>16</code>]</dt>
- * <dd>The initial capacity of the map used for storing the entries.<br>
- * {@link RegionAttributes#getInitialCapacity}</dd>
- *
- * <dt>LoadFactor [<em>default:</em> <code>0.75</code>]</dt>
- * <dd>The load factor of the map used for storing the entries.<br>
- * {@link RegionAttributes#getLoadFactor}</dd>
- *
- * <dt>ConcurrencyLevel [<em>default:</em> <code>16</code>]</dt>
- * <dd>The allowed concurrency among updates to values in the region
- * is guided by the <tt>concurrencyLevel</tt>, which is used as a hint
- * for internal sizing. The actual concurrency will vary.
- * Ideally, you should choose a value to accommodate as many
- * threads as will ever concurrently modify values in the region. Using
- * a
- * significantly higher value than you need can waste space and time,
- * and a significantly lower value can lead to thread contention. But
- * overestimates and underestimates within an order of magnitude do
- * not usually have much noticeable impact. A value of one is
- * appropriate when it is known that only one thread will modify
- * and all others will only read.<br>
- * {@link #setConcurrencyLevel} {@link
- * RegionAttributes#getConcurrencyLevel}</dd>
- *
- * <dt>StatisticsEnabled [<em>default:</em> <code>false</code>]</dt>
- * <dd>Whether statistics are enabled for this region. The default
- * is disabled, which conserves on memory.<br>
- * {@link #setStatisticsEnabled} {@link
- * RegionAttributes#getStatisticsEnabled}</dd>
- *
- *
- * </dl>
- *
- *
- * @see RegionAttributes
- * @see AttributesMutator
- * @see Region#createSubregion(String, RegionAttributes)
- */
-
-class CPPCACHE_EXPORT AttributesFactory : public SharedBase {
- /**
- * @brief public methods
- */
- public:
- /**
- *@brief constructor
- */
-
- /** Creates a new instance of AttributesFactory ready to create a
- * <code>RegionAttributes</code> with default settings.
- */
- AttributesFactory();
-
- /** Creates a new instance of AttributesFactory ready to create a
- * <code>RegionAttributes</code> with the same settings as those in the
- * specified <code>RegionAttributes</code>.
- * @param regionAttributes the <code>RegionAttributes</code> used to
- * initialize this AttributesFactory
- */
- AttributesFactory(const RegionAttributesPtr& regionAttributes);
-
- /**
- *@brief destructor
- */
- virtual ~AttributesFactory();
-
- // CALLBACKS
-
- /** Sets the cache loader for the next <code>RegionAttributes</code> created.
- * @param cacheLoader the cache loader or NULLPTR if no loader
- */
- void setCacheLoader(const CacheLoaderPtr& cacheLoader);
-
- /** Sets the cache writer for the next <code>RegionAttributes</code> created.
- * @param cacheWriter the cache writer or NULLPTR if no cache writer
- */
- void setCacheWriter(const CacheWriterPtr& cacheWriter);
-
- /** Sets the CacheListener for the next <code>RegionAttributes</code> created.
- * @param aListener a user defined CacheListener, NULLPTR if no listener
- */
- void setCacheListener(const CacheListenerPtr& aListener);
-
- /** Sets the PartitionResolver for the next <code>RegionAttributes</code>
- * created.
- * @param aResolver a user defined PartitionResolver, NULLPTR if no resolver
- */
- void setPartitionResolver(const PartitionResolverPtr& aResolver);
-
- /**
- * Sets the library path for the library that will be invoked for the loader
- * of the region.
- */
- void setCacheLoader(const char* libpath, const char* factoryFuncName);
-
- /**
- * Sets the library path for the library that will be invoked for the writer
- * of the region.
- */
-
- void setCacheWriter(const char* libpath, const char* factoryFuncName);
-
- /**
- * Sets the library path for the library that will be invoked for the listener
- * of the region.
- */
- void setCacheListener(const char* libpath, const char* factoryFuncName);
-
- /**
- * Sets the library path for the library that will be invoked for the
- * partition resolver of the region.
- */
- void setPartitionResolver(const char* libpath, const char* factoryFuncName);
-
- // EXPIRATION ATTRIBUTES
-
- /** Sets the idleTimeout expiration attributes for region entries for the next
- * <code>RegionAttributes</code> created.
- * @param action the expiration action for entries in this region.
- * @param idleTimeout the idleTimeout in seconds for entries in this region.
- */
- void setEntryIdleTimeout(ExpirationAction::Action action,
- int32_t idleTimeout);
-
- /** Sets the timeToLive expiration attributes for region entries for the next
- * <code>RegionAttributes</code> created.
- * @param action the expiration action for entries in this region.
- * @param timeToLive the timeToLive in seconds for entries in this region.
- */
- void setEntryTimeToLive(ExpirationAction::Action action, int32_t timeToLive);
-
- /** Sets the idleTimeout expiration attributes for the region itself for the
- * next <code>RegionAttributes</code> created.
- * @param action the expiration action for entries in this region.
- * @param idleTimeout the idleTimeout in seconds for the region as a whole.
- */
- void setRegionIdleTimeout(ExpirationAction::Action action,
- int32_t idleTimeout);
-
- /** Sets the timeToLive expiration attributes for the region itself for the
- * next <code>RegionAttributes</code> created.
- * @param action the expiration action for entries in this region.
- * @param timeToLive the timeToLive in seconds for the region as a whole.
- */
- void setRegionTimeToLive(ExpirationAction::Action action, int32_t timeToLive);
-
- // PERSISTENCE
- /**
- * Sets the library path for the library that will be invoked for the
- * persistence of the region.
- * If the region is being created from a client on a server, or on a server
- * directly, then
- * this must be used to set the PersistenceManager.
- */
- void setPersistenceManager(const char* libpath, const char* factoryFuncName,
- const PropertiesPtr& config = NULLPTR);
-
- /** Sets the PersistenceManager for the next <code>RegionAttributes</code>
- * created.
- * @param persistenceManager a user defined PersistenceManager, NULLPTR if no
- * resolver
- */
- void setPersistenceManager(const PersistenceManagerPtr& persistenceManager,
- const PropertiesPtr& config = NULLPTR);
-
- public:
- // DISTRIBUTION ATTRIBUTES
-
- // MAP ATTRIBUTES
- /** Sets the entry initial capacity for the next <code>RegionAttributes</code>
- * created. This value
- * is used in initializing the map that holds the entries.
- * @param initialCapacity the initial capacity of the entry map
- * @throws IllegalArgumentException if initialCapacity is negative.
- */
- void setInitialCapacity(int initialCapacity);
-
- /** Sets the entry load factor for the next <code>RegionAttributes</code>
- * created. This value is
- * used in initializing the map that holds the entries.
- * @param loadFactor the load factor of the entry map
- * @throws IllegalArgumentException if loadFactor is nonpositive
- */
- void setLoadFactor(float loadFactor);
-
- /** Sets the concurrency level tof the next <code>RegionAttributes</code>
- * created. This value is used in initializing the map that holds the entries.
- * @param concurrencyLevel the concurrency level of the entry map
- * @throws IllegalArgumentException if concurrencyLevel is nonpositive
- */
- void setConcurrencyLevel(uint8_t concurrencyLevel);
-
- /**
- * Sets a limit on the number of entries that will be held in the cache.
- * If a new entry is added while at the limit, the cache will evict the
- * least recently used entry. Defaults to 0, meaning no LRU actions will
- * used.
- */
- void setLruEntriesLimit(const uint32_t entriesLimit);
-
- /** Sets the Disk policy type for the next <code>RegionAttributes</code>
- * created.
- * @param diskPolicy the type of disk policy to use for the region
- * @throws IllegalArgumentException if diskPolicyType is Invalid
- */
- void setDiskPolicy(const DiskPolicyType::PolicyType diskPolicy);
-
- /**
- * Set caching enabled flag for this region. If set to false, then no data is
- * stored
- * in the local process, but events and distributions will still occur, and
- * the region can still be used to put and remove, etc...
- * The default if not set is 'true'.
- * This also requires that interestLists are turned off for the region.
- * @param cachingEnabled if true, cache data for this region in this process.
- */
- void setCachingEnabled(bool cachingEnabled);
-
- /**
- * Sets the pool name attribute.
- * This causes regions that use these attributes
- * to be a client region which communicates with the
- * servers that the connection pool communicates with.
- * <p>If this attribute is set to <code>null</code> or <code>""</code>
- * then the connection pool is disabled causing regions that use these
- * attributes
- * to be communicate with peers instead of servers.
- * <p>The named connection pool must exist on the cache at the time these
- * attributes are used to create a region. See {@link
- * PoolManager#createFactory}
- * for how to create a connection pool.
- * @param name the name of the connection pool to use; if <code>null</code>
- * or <code>""</code> then the connection pool is disabled for regions
- * using these attributes.
- */
- void setPoolName(const char* name);
-
- /**
- * Sets cloning on region
- * @param isClonable
- * @see RegionAttributes#getCloningEnabled()
- */
- void setCloningEnabled(bool isClonable);
-
- /**
- * Enables or disables concurrent modification checks
- * @since 7.0
- * @param concurrencyChecksEnabled whether to perform concurrency checks on
- * operations
- */
- void setConcurrencyChecksEnabled(bool concurrencyChecksEnabled);
-
- // FACTORY METHOD
-
- /** Creates a <code>RegionAttributes</code> with the current settings.
- * @return the newly created <code>RegionAttributes</code>
- * @throws IllegalStateException if the current settings violate the
- * compatibility rules
- */
- RegionAttributesPtr createRegionAttributes();
-
- private:
- RegionAttributes m_regionAttributes;
- static void validateAttributes(RegionAttributes& attrs);
-};
-} // namespace client
-} // namespace geode
-} // namespace apache
-
-#endif // GEODE_GFCPP_ATTRIBUTESFACTORY_H_
http://git-wip-us.apache.org/repos/asf/geode-native/blob/fd58b100/src/cppcache/include/gfcpp/AttributesMutator.hpp
----------------------------------------------------------------------
diff --git a/src/cppcache/include/gfcpp/AttributesMutator.hpp b/src/cppcache/include/gfcpp/AttributesMutator.hpp
deleted file mode 100644
index 03bfa81..0000000
--- a/src/cppcache/include/gfcpp/AttributesMutator.hpp
+++ /dev/null
@@ -1,193 +0,0 @@
-#pragma once
-
-#ifndef GEODE_GFCPP_ATTRIBUTESMUTATOR_H_
-#define GEODE_GFCPP_ATTRIBUTESMUTATOR_H_
-
-/*
- * 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.
- */
-
-#include "gfcpp_globals.hpp"
-#include "gf_types.hpp"
-#include "ExpirationAction.hpp"
-/**
- * @file
- */
-
-namespace apache {
-namespace geode {
-namespace client {
-
-class CacheListener;
-class CacheLoader;
-class CacheWriter;
-
-/**
- * @class AttributesMutator AttributesMutator.hpp
- *
- * Supports modification of certain region attributes after the region has been
- * created. It is required that the attributes be completely initialized
- * using an {@link AttributesFactory} before creating the region.
- *AttributesMutator
- * can be applied to adjusting and tuning a subset of attributes that are
- *modifiable
- * at runtime.
- *<p>
- * The setter methods all return the previous value of the attribute.
- *
- * @see Region::getAttributesMutator
- * @see RegionAttributes
- * @see AttributesFactory
- */
-class CPPCACHE_EXPORT AttributesMutator : public SharedBase {
- private:
- RegionPtr m_region;
-
- public:
- /** Internal constructor. Use Region::getAttributesMutator() to acquire the
- * mutator for a region. */
- AttributesMutator(const RegionPtr& region);
-
- virtual ~AttributesMutator();
-
- /** Sets the idleTimeout duration for region entries.
- * @param idleTimeout the idleTimeout in seconds for entries in this region.
- * @return the previous value.
- * @throw IllegalStateException if the new idleTimeout changes entry
- * expiration from
- * disabled to enabled or enabled to disabled.
- */
- int32_t setEntryIdleTimeout(int32_t idleTimeout);
-
- /** Set the idleTimeout Action for region entries.
- * @param action the idleTimeout ExpirationAction::Action for entries in this
- * region.
- * @return the previous value.
- */
- ExpirationAction::Action setEntryIdleTimeoutAction(
- ExpirationAction::Action action);
-
- /** Sets the timeToLive duration for region entries.
- * @param timeToLive the timeToLive in seconds for entries in this region.
- * @return the previous value.
- * @throw IllegalStateException if the new timeToLive changes entry expiration
- * from
- * disabled to enabled or enabled to disabled.
- */
- int32_t setEntryTimeToLive(int32_t timeToLive);
-
- /** Set the timeToLive Action for region entries.
- * @param action the timeToLive ExpirationAction::Action for entries in this
- * region.
- * @return the previous value.
- */
- ExpirationAction::Action setEntryTimeToLiveAction(
- ExpirationAction::Action action);
-
- /** Sets the idleTimeout duration for the region itself.
- * @param idleTimeout the ExpirationAttributes for this region idleTimeout
- * @return the previous value.
- * @throw IllegalStateException if the new idleTimeout changes region
- * expiration from
- * disabled to enabled or enabled to disabled.
- */
- int32_t setRegionIdleTimeout(int32_t idleTimeout);
-
- /** Set the idleTimeout Action for the region itself.
- * @param action the idleTimeout ExpirationAction::Action for this region.
- * @return the previous value.
- */
- ExpirationAction::Action setRegionIdleTimeoutAction(
- ExpirationAction::Action action);
-
- /** Sets the timeToLive duration for the region itself.
- * @param timeToLive the ExpirationAttributes for this region timeToLive
- * @return the previous value.
- * @throw IllegalStateException if the new timeToLive changes region
- * expiration from
- * disabled to enabled or enabled to disabled.
- */
- int32_t setRegionTimeToLive(int32_t timeToLive);
-
- /** Set the timeToLive Action for the region itself.
- * @param action the timeToLive ExpirationAction::Action for this region.
- * @return the previous value.
- */
- ExpirationAction::Action setRegionTimeToLiveAction(
- ExpirationAction::Action action);
-
- /** Sets the Maximum entry count in the region before LRU eviction.
- * @param entriesLimit the number of entries to allow.
- * @return the previous value.
- * @throw IllegalStateException if the new entriesLimit changes LRU from
- * disabled to enabled or enabled to disabled.
- */
- uint32_t setLruEntriesLimit(uint32_t entriesLimit);
-
- /** Sets cache listener for region. The previous cache listener will be
- * replaced with
- * <code>aListener</code>.
- * @param aListener cache listener
- */
- void setCacheListener(const CacheListenerPtr& aListener);
-
- /** Sets cache listener for region. The previous cache listener will be
- * replaced with
- * a listener created using the factory function provided in the given
- * library.
- * @param libpath path of the library containing cache listener factory
- * function.
- * @param factoryFuncName factory function for creating cache listener.
- */
- void setCacheListener(const char* libpath, const char* factoryFuncName);
-
- /** Sets cache loader for region. The previous cache loader will be replaced
- * with
- * <code>aLoader</code>.
- * @param aLoader cache loader
- */
- void setCacheLoader(const CacheLoaderPtr& aLoader);
-
- /** Sets cache loader for region. The previous cache loader will be replaced
- * with
- * a loader created using the factory function provided in the given library.
- * @param libpath path of the library containing cache loader factory
- * function.
- * @param factoryFuncName factory function for creating cache loader.
- */
- void setCacheLoader(const char* libpath, const char* factoryFuncName);
-
- /** Sets cache writer for region. The previous cache writer will be replaced
- * with
- * <code>aWriter</code>.
- * @param aWriter cache writer
- */
- void setCacheWriter(const CacheWriterPtr& aWriter);
-
- /** Sets cache writer for region. The previous cache writer will be replaced
- * with
- * a writer created using the factory function provided in the given library.
- * @param libpath path of the library containing cache writer factory
- * function.
- * @param factoryFuncName factory function for creating cache writer.
- */
- void setCacheWriter(const char* libpath, const char* factoryFuncName);
-};
-} // namespace client
-} // namespace geode
-} // namespace apache
-
-#endif // GEODE_GFCPP_ATTRIBUTESMUTATOR_H_
http://git-wip-us.apache.org/repos/asf/geode-native/blob/fd58b100/src/cppcache/include/gfcpp/AuthInitialize.hpp
----------------------------------------------------------------------
diff --git a/src/cppcache/include/gfcpp/AuthInitialize.hpp b/src/cppcache/include/gfcpp/AuthInitialize.hpp
deleted file mode 100644
index 8c17de7..0000000
--- a/src/cppcache/include/gfcpp/AuthInitialize.hpp
+++ /dev/null
@@ -1,68 +0,0 @@
-#pragma once
-
-#ifndef GEODE_GFCPP_AUTHINITIALIZE_H_
-#define GEODE_GFCPP_AUTHINITIALIZE_H_
-
-/*
- * 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.
- */
-
-/**
- * @file
- */
-
-#include "gfcpp_globals.hpp"
-#include "gf_types.hpp"
-
-namespace apache {
-namespace geode {
-namespace client {
-
-/**
- * @class AuthInitialize AuthInitialize.hpp
- * Specifies the mechanism to obtain credentials for a client.
- * It is mandantory for clients when the server is running in secure
- * mode having a <code>security-client-authenticator</code> module specified.
- * Implementations should register the library path as
- * <code>security-client-auth-library</code> system property and factory
- * function (a zero argument function returning pointer to an
- * AuthInitialize object) as the <code>security-client-auth-factory</code>
- * system property.
- */
-class CPPCACHE_EXPORT AuthInitialize
- : public ::apache::geode::client::SharedBase {
- public:
- /**@brief initialize with the given set of security properties
- * and return the credentials for the client as properties.
- * @param props the set of security properties provided to the
- * <code>DistributedSystem.connect</code> method
- * @param server it is the ID of the current endpoint.
- * The format expected is "host:port".
- * @returns the credentials to be used for the given <code>server</code>
- * @remarks This method can modify the given set of properties. For
- * example it may invoke external agents or even interact with the user.
- */
- virtual PropertiesPtr getCredentials(PropertiesPtr& securityprops,
- const char* server) = 0;
-
- /**@brief Invoked before the cache goes down. */
- virtual void close() = 0;
-};
-} // namespace client
-} // namespace geode
-} // namespace apache
-
-#endif // GEODE_GFCPP_AUTHINITIALIZE_H_
http://git-wip-us.apache.org/repos/asf/geode-native/blob/fd58b100/src/cppcache/include/gfcpp/Cache.hpp
----------------------------------------------------------------------
diff --git a/src/cppcache/include/gfcpp/Cache.hpp b/src/cppcache/include/gfcpp/Cache.hpp
deleted file mode 100644
index 00ed79d..0000000
--- a/src/cppcache/include/gfcpp/Cache.hpp
+++ /dev/null
@@ -1,253 +0,0 @@
-#pragma once
-
-#ifndef GEODE_GFCPP_CACHE_H_
-#define GEODE_GFCPP_CACHE_H_
-
-/*
- * 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.
- */
-#include "gfcpp_globals.hpp"
-#include "gf_types.hpp"
-#include "GeodeCache.hpp"
-#include "gf_types.hpp"
-#include "Region.hpp"
-#include "DistributedSystem.hpp"
-#include "QueryService.hpp"
-#include "PoolFactory.hpp"
-#include "RegionShortcut.hpp"
-#include "RegionFactory.hpp"
-#include "InternalCacheTransactionManager2PC.hpp"
-
-/**
- * @file
- */
-
-namespace apache {
-namespace geode {
-namespace client {
-
-class CacheFactory;
-class CacheRegionHelper;
-class Pool;
-
-/**
- * @class Cache Cache.hpp
- *
- * Cache are obtained from create method on the {@link CacheFactory#create}
- * class
- * <p>
- * When a cache will no longer be used, it should be {@link #close closed}.
- * Once it {@link Cache::isClosed is closed} any attempt to use it
- * will cause a <code>CacheClosedException</code> to be thrown.
- *
- * <p>A cache can have multiple root regions, each with a different name.
- *
- */
-class CPPCACHE_EXPORT Cache : public GeodeCache {
- /**
- * @brief public methods
- */
- public:
- /**
- * Returns the {@link RegionFactory} to create the region.
- * Before creating the Region, one can set region attributes using this
- * instance.
- *
- * @param regionShortcut
- * To create the region specific type, @see RegionShortcut
- */
- virtual RegionFactoryPtr createRegionFactory(RegionShortcut regionShortcut);
-
- /**
- * Initializes the cache from an xml file
- *
- * @param cacheXml
- * Valid cache.xml file
- */
- virtual void initializeDeclarativeCache(const char* cacheXml);
-
- /** Returns the name of this cache.
- * @return the string name of this cache
- */
- virtual const char* getName() const;
-
- /**
- * Indicates if this cache has been closed.
- * After a new cache object is created, this method returns false;
- * After the close is called on this cache object, this method
- * returns true.
- *
- * @return true, if this cache is closed; false, otherwise
- */
- virtual bool isClosed() const;
-
- /**
- * Returns the distributed system that this cache was
- * {@link CacheFactory::createCacheFactory created} with.
- */
- virtual DistributedSystemPtr getDistributedSystem() const;
-
- /**
- * Terminates this object cache and releases all the local resources.
- * After this cache is closed, any further
- * method call on this cache or any region object will throw
- * <code>CacheClosedException</code>, unless otherwise noted.
- * If Cache instance created from Pool(pool is in multiuser mode), then it
- * reset user related security data.
- * @throws CacheClosedException, if the cache is already closed.
- */
- virtual void close();
-
- /**
- * Terminates this object cache and releases all the local resources.
- * After this cache is closed, any further
- * method call on this cache or any region object will throw
- * <code>CacheClosedException</code>, unless otherwise noted.
- * If Cache instance created from Pool(pool is in multiuser mode), then it
- * reset user related security data.
- * @param keepalive whether to keep a durable client's queue alive
- * @throws CacheClosedException, if the cache is already closed.
- */
- virtual void close(bool keepalive);
-
- /** Look up a region with the full path from root.
- *
- * If Pool attached with Region is in multiusersecure mode then don't use
- * return instance of region as no credential are attached with this instance.
- * Get region from RegionService instance of Cache.@see
- * Cache#createAuthenticatedView(PropertiesPtr).
- *
- * @param path the region's name, such as <code>AuthRegion</code>.
- * @returns region, or NULLPTR if no such region exists.
- */
- virtual RegionPtr getRegion(const char* path);
-
- /**
- * Returns a set of root regions in the cache. This set is a snapshot and
- * is not backed by the Cache. The vector passed in is cleared and the
- * regions are added to it.
- *
- * @param regions the returned set of
- * regions
- */
- virtual void rootRegions(VectorOfRegion& regions);
-
- /**
- * Gets the QueryService from which a new Query can be obtained.
- * @returns A smart pointer to the QueryService.
- */
- virtual QueryServicePtr getQueryService();
-
- /**
- * Gets the QueryService from which a new Query can be obtained.
- * @param poolName
- * Pass poolname if pool is created from cache.xml or {@link
- * PoolManager}
- * @returns A smart pointer to the QueryService.
- */
- virtual QueryServicePtr getQueryService(const char* poolName);
-
- /**
- * Send the "client ready" message to the server from a durable client.
- */
- virtual void readyForEvents();
-
- /**
- * Creates an authenticated cache using the given user security properties.
- * Multiple instances with different user properties can be created with a
- * single client cache.
- *
- * Application must use this instance to do operations, when
- * multiuser-authentication is set to true.
- *
- * @see RegionService
- * @see PoolFactory#setMultiuserAuthentication(boolean)
- * @return the {@link RegionService} instance associated with a user and given
- * properties.
- * @throws UnsupportedOperationException
- * when invoked with multiuser-authentication as false.
- *
- * @param userSecurityProperties
- * the security properties of a user.
- *
- * @param poolName
- * the pool that the users should be authenticated against. Set if
- * there are more than one Pool in Cache.
- */
-
- virtual RegionServicePtr createAuthenticatedView(
- PropertiesPtr userSecurityProperties, const char* poolName = NULL);
-
- /**
- * Get the CacheTransactionManager instance for this Cache.
- * @return The CacheTransactionManager instance.
- * @throws CacheClosedException if the cache is closed.
- */
- virtual CacheTransactionManagerPtr getCacheTransactionManager();
-
- /**
- * Returns whether Cache saves unread fields for Pdx types.
- */
- virtual bool getPdxIgnoreUnreadFields();
-
- /**
- * Returns whether { @link PdxInstance} is preferred for PDX types instead of
- * C++ object.
- */
- virtual bool getPdxReadSerialized();
-
- /**
- * Returns a factory that can create a {@link PdxInstance}.
- * @param className the fully qualified class name that the PdxInstance will
- * become
- * when it is fully deserialized.
- * @throws IllegalStateException if the className is NULL or invalid.
- * @return the factory
- */
- virtual PdxInstanceFactoryPtr createPdxInstanceFactory(const char* className);
-
- /**
- * @brief destructor
- */
- virtual ~Cache();
-
- private:
- /**
- * @brief constructors
- */
- Cache(const char* name, DistributedSystemPtr sys, bool ignorePdxUnreadFields,
- bool readPdxSerialized);
- Cache(const char* name, DistributedSystemPtr sys, const char* id_data,
- bool ignorePdxUnreadFields, bool readPdxSerialized);
- CacheImpl* m_cacheImpl;
-
- protected:
- Cache() { m_cacheImpl = NULL; }
-
- static bool isPoolInMultiuserMode(RegionPtr regionPtr);
-
- friend class CacheFactory;
- friend class CacheRegionHelper;
- friend class Pool;
- friend class FunctionService;
- friend class CacheXmlCreation;
- friend class RegionXmlCreation;
-};
-} // namespace client
-} // namespace geode
-} // namespace apache
-
-#endif // GEODE_GFCPP_CACHE_H_
http://git-wip-us.apache.org/repos/asf/geode-native/blob/fd58b100/src/cppcache/include/gfcpp/CacheAttributes.hpp
----------------------------------------------------------------------
diff --git a/src/cppcache/include/gfcpp/CacheAttributes.hpp b/src/cppcache/include/gfcpp/CacheAttributes.hpp
deleted file mode 100644
index e52dd89..0000000
--- a/src/cppcache/include/gfcpp/CacheAttributes.hpp
+++ /dev/null
@@ -1,108 +0,0 @@
-#pragma once
-
-#ifndef GEODE_GFCPP_CACHEATTRIBUTES_H_
-#define GEODE_GFCPP_CACHEATTRIBUTES_H_
-
-/*
- * 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.
- */
-
-/**
- * @file
- */
-
-#include "gfcpp_globals.hpp"
-#include "gf_types.hpp"
-
-namespace apache {
-namespace geode {
-namespace client {
-
-/**
- * @class CacheAttributes CacheAttributes.hpp
- * Defines attributes for configuring a cache.
- * Currently the following attributes are defined:
- * redundancyLevel: Redundancy for HA client queues.
- * endpoints: Cache level endpoints list.
- *
- * To create an instance of this interface, use {@link
- * CacheAttributesFactory::createCacheAttributes}.
- *
- * For compatibility rules and default values, see {@link
- * CacheAttributesFactory}.
- *
- * <p>Note that the <code>CacheAttributes</code> are not distributed with the
- * region.
- *
- * @see CacheAttributesFactory
- */
-class CacheAttributesFactory;
-
-_GF_PTR_DEF_(CacheAttributes, CacheAttributesPtr);
-
-class CPPCACHE_EXPORT CacheAttributes : public SharedBase {
- /**
- * @brief public static methods
- */
- public:
- /**
- * Gets redundancy level for regions in the cache.
- */
- int getRedundancyLevel();
-
- /**
- * Gets cache level endpoints list.
- */
- char* getEndpoints();
-
- ~CacheAttributes();
-
- bool operator==(const CacheAttributes& other) const;
-
- bool operator!=(const CacheAttributes& other) const;
-
- private:
- /** Sets redundancy level.
- *
- */
- void setRedundancyLevel(int redundancyLevel);
-
- /** Sets cache level endpoints list.
- *
- */
- void setEndpoints(char* endpoints);
- // will be created by the factory
-
- CacheAttributes(const CacheAttributes& rhs);
- CacheAttributes();
-
- int32_t compareStringAttribute(char* attributeA, char* attributeB) const;
- void copyStringAttribute(char*& lhs, const char* rhs);
-
- int m_redundancyLevel;
- char* m_endpoints;
- bool m_cacheMode;
-
- friend class CacheAttributesFactory;
- friend class CacheImpl;
-
- const CacheAttributes& operator=(const CacheAttributes&);
-};
-} // namespace client
-} // namespace geode
-} // namespace apache
-
-#endif // GEODE_GFCPP_CACHEATTRIBUTES_H_