http://git-wip-us.apache.org/repos/asf/geode-native/blob/da389793/src/tests/cli/NewFwkLib/FwkTest.cs ---------------------------------------------------------------------- diff --git a/src/tests/cli/NewFwkLib/FwkTest.cs b/src/tests/cli/NewFwkLib/FwkTest.cs index 904e3c3..da7e5a8 100644 --- a/src/tests/cli/NewFwkLib/FwkTest.cs +++ b/src/tests/cli/NewFwkLib/FwkTest.cs @@ -608,16 +608,16 @@ namespace Apache.Geode.Client.FwkLib public virtual void CreatePool() { CreateCache(); - PoolFactory pf = PoolManager.CreateFactory(); + PoolFactory pf = CacheHelper<TKey, TVal>.DCache.GetPoolFactory(); ResetKey("poolSpec"); string poolRegionData = GetStringValue("poolSpec"); FwkInfo("PoolSpec is :{0}", poolRegionData); string poolName = null; SetPoolAttributes(pf, poolRegionData, ref poolName); - if (PoolManager.Find(poolName) == null) + if (CacheHelper<TKey, TVal>.DCache.GetPoolManager().Find(poolName) == null) { - Pool pool = pf.Create(poolName); + Pool pool = pf.Create(poolName, CacheHelper<TKey, TVal>.DCache); FwkInfo("Pool attributes are {0}:", PoolAttributesToString(pool)); } } @@ -964,9 +964,6 @@ namespace Apache.Geode.Client.FwkLib String createCacheLoader = myType.Namespace + '.' + loaderlibrary + "<" + typeof(TKey) + "," + typeof(TVal) + ">." + "createCacheLoader"; - if (String.Compare(loaderfunction, createCacheLoader, true) == 0) { - loader = new PerfCacheLoader<TKey, TVal>(); - } Util.Log(Util.LogLevel.Info, "Instantiated Loader = {0} ", loaderfunction); af.SetCacheLoader(loader); } @@ -1054,12 +1051,6 @@ namespace Apache.Geode.Client.FwkLib else if (String.Compare(listenerfunction, createDurablePerfListener, true) == 0) { listener = new DurablePerfListener<TKey, TVal>(); } - else if (String.Compare(listenerfunction, CreateDurableCacheListenerSP, true) == 0) { - listener = new DurableCacheListener<TKey, TVal>(); - } - else if (String.Compare(listenerfunction, createLatencyListener, true) == 0) { - listener = new LatencyListeners<TKey, TVal>(InitPerfStat.perfstat[0]); - } else if (String.Compare(listenerfunction, createSilenceListener, true) == 0) { listener = new SilenceListener<TKey, TVal>(); @@ -1303,7 +1294,7 @@ namespace Apache.Geode.Client.FwkLib //Properties rootAttrs = GetNewRegionAttributes(rootRegionData); // Check if this is a thin-client region; if so set the endpoints RegionFactory rootAttrs = null; - //RegionFactory rootAttrs = CacheHelper.DCache.CreateRegionFactory(RegionShortcut.PROXY); + //RegionFactory rootAttrs = CacheHelper<TKey, TVal>.DCache.CreateRegionFactory(RegionShortcut.PROXY); string m_isPool = null; //SetRegionAttributes(rootAttrs, rootRegionData, ref m_isPool); int redundancyLevel = 0; @@ -1358,7 +1349,7 @@ namespace Apache.Geode.Client.FwkLib private void ParseEndPoints(string ep, bool isServer, int redundancyLevel) { string poolName = "_Test_Pool"; - PoolFactory pf = PoolManager.CreateFactory(); + PoolFactory pf = CacheHelper<TKey, TVal>.DCache.GetPoolFactory(); string[] eps = ep.Split(','); foreach (string endpoint in eps) { @@ -1397,9 +1388,9 @@ namespace Apache.Geode.Client.FwkLib if (redundancyLevel > 0) pf.SetSubscriptionRedundancy(redundancyLevel); - if (PoolManager.Find(poolName) == null) + if (CacheHelper<TKey, TVal>.DCache.GetPoolManager().Find(poolName) == null) { - Pool pool = pf.Create(poolName); + Pool pool = pf.Create(poolName, CacheHelper<TKey, TVal>.DCache); FwkInfo("Pool attributes are {0}:", PoolAttributesToString(pool)); } FwkInfo("Create Pool complete with poolName= {0}", poolName); @@ -1515,7 +1506,7 @@ namespace Apache.Geode.Client.FwkLib public QueryService<TKey, object> CheckQueryService() { string mode = Util.GetEnvironmentVariable("POOLOPT"); - Pool/*<TKey, TVal>*/ pool = PoolManager/*<TKey, TVal>*/.Find("_Test_Pool"); + Pool/*<TKey, TVal>*/ pool = CacheHelper<TKey, TVal>.DCache.GetPoolManager().Find("_Test_Pool"); return pool.GetQueryService<TKey, object>(); }
http://git-wip-us.apache.org/repos/asf/geode-native/blob/da389793/src/tests/cli/NewFwkLib/NewFwkLib.csproj.in ---------------------------------------------------------------------- diff --git a/src/tests/cli/NewFwkLib/NewFwkLib.csproj.in b/src/tests/cli/NewFwkLib/NewFwkLib.csproj.in index ebcf743..f58de91 100644 --- a/src/tests/cli/NewFwkLib/NewFwkLib.csproj.in +++ b/src/tests/cli/NewFwkLib/NewFwkLib.csproj.in @@ -230,48 +230,13 @@ <Compile Include="$(CMAKE_CURRENT_SOURCE_DIR)\NewFwkLib\ResumableTx\TxInfo.cs"> <Link>ResumableTx\TxInfo.cs</Link> </Compile> - <Compile Include="$(CMAKE_CURRENT_SOURCE_DIR)\NewFwkLib\SmokePerf\ObjectHelper.cs"> - <Link>SmokePerf\ObjectHelper.cs</Link> - </Compile> - <Compile Include="$(CMAKE_CURRENT_SOURCE_DIR)\NewFwkLib\SmokePerf\PerfStat.cs"> - <Link>SmokePerf\PerfStat.cs</Link> - </Compile> - <Compile Include="$(CMAKE_CURRENT_SOURCE_DIR)\NewFwkLib\SmokePerf\SmokePerf.cs"> - <Link>SmokePerf\SmokePerf.cs</Link> - </Compile> - <Compile Include="$(CMAKE_CURRENT_SOURCE_DIR)\NewFwkLib\SmokePerf\SmokeTasks.cs"> - <Link>SmokePerf\SmokeTasks.cs</Link> - </Compile> <Compile Include="$(CMAKE_CURRENT_SOURCE_DIR)\NewFwkLib\Utils.cs"> <Link>Utils.cs</Link> </Compile> - <Compile Include="$(CMAKE_CURRENT_SOURCE_DIR)\NewTestObject\ArrayOfByte.cs"> - <Link>SmokePerf\ArrayOfByte.cs</Link> - </Compile> - <Compile Include="$(CMAKE_CURRENT_SOURCE_DIR)\NewTestObject\BatchObject.cs"> - <Link>SmokePerf\BatchObject.cs</Link> - </Compile> - <Compile Include="$(CMAKE_CURRENT_SOURCE_DIR)\NewTestObject\DeltaFastAssetAccount.cs"> - <Link>SmokePerf\DeltaFastAssetAccount.cs</Link> - </Compile> - <Compile Include="$(CMAKE_CURRENT_SOURCE_DIR)\NewTestObject\DeltaPSTObject.cs"> - <Link>SmokePerf\DeltaPSTObject.cs</Link> - </Compile> <Compile Include="$(CMAKE_CURRENT_SOURCE_DIR)\NewTestObject\DeltaTestImpl.cs"> <Link>DeltaTest\DeltaTestImpl.cs</Link> </Compile> - <Compile Include="$(CMAKE_CURRENT_SOURCE_DIR)\NewTestObject\EqStruct.cs"> - <Link>SmokePerf\EqStruct.cs</Link> - </Compile> - <Compile Include="$(CMAKE_CURRENT_SOURCE_DIR)\NewTestObject\FastAsset.cs"> - <Link>SmokePerf\FastAsset.cs</Link> - </Compile> - <Compile Include="$(CMAKE_CURRENT_SOURCE_DIR)\NewTestObject\FastAssetAccount.cs"> - <Link>SmokePerf\FastAssetAccount.cs</Link> - </Compile> - <Compile Include="$(CMAKE_CURRENT_SOURCE_DIR)\NewTestObject\NoopAuthInit.cs"> - <Link>SmokePerf\NoopAuthInit.cs</Link> - </Compile> + <Compile Include="$(CMAKE_CURRENT_SOURCE_DIR)\NewTestObject\PdxAutoSerializerObj.cs"> <Link>PdxTest\PdxAutoSerializerObj.cs</Link> </Compile> @@ -287,16 +252,10 @@ <Compile Include="$(CMAKE_CURRENT_SOURCE_DIR)\NewTestObject\PositionPdx.cs"> <Link>QueryTest\PositionPdx.cs</Link> </Compile> - <Compile Include="$(CMAKE_CURRENT_SOURCE_DIR)\NewTestObject\PSTObject.cs"> - <Link>SmokePerf\PSTObject.cs</Link> - </Compile> <Compile Include="$(CMAKE_CURRENT_SOURCE_DIR)\NewTestObject\TestObject1.cs"> <Link>DeltaTest\TestObject1.cs</Link> </Compile> - <Compile Include="$(CMAKE_CURRENT_SOURCE_DIR)\NewTestObject\TimeStampdObject.cs"> - <Link>SmokePerf\TimeStampdObject.cs</Link> - </Compile> - <Compile Include="$(CMAKE_CURRENT_SOURCE_DIR)\QueryHelper\QueryHelperN.cs"> + <Compile Include="$(CMAKE_CURRENT_SOURCE_DIR)\QueryHelper\QueryHelperN.cs"> <Link>QueryTest\QueryHelperN.cs</Link> </Compile> </ItemGroup> http://git-wip-us.apache.org/repos/asf/geode-native/blob/da389793/src/tests/cli/NewFwkLib/PdxTest/PdxTests.cs ---------------------------------------------------------------------- diff --git a/src/tests/cli/NewFwkLib/PdxTest/PdxTests.cs b/src/tests/cli/NewFwkLib/PdxTest/PdxTests.cs index 12d6186..5962fe4 100644 --- a/src/tests/cli/NewFwkLib/PdxTest/PdxTests.cs +++ b/src/tests/cli/NewFwkLib/PdxTest/PdxTests.cs @@ -39,8 +39,7 @@ namespace Apache.Geode.Client.FwkLib { long currentTimeInMillies() { - DateTime startTime = DateTime.Now; - long curruntMillis = SmokePerf<TKey, TVal>.GetDateTimeMillis(startTime); + long curruntMillis = DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond; return curruntMillis; } public override void AfterCreate(EntryEvent<TKey, TVal> ev) @@ -1028,7 +1027,7 @@ namespace Apache.Geode.Client.FwkLib { FwkTest<TKey, TVal>.CurrentTest.ResetKey(ObjectType); string objectType = GetStringValue(ObjectType); - QueryHelper<TKey, TVal> qh = QueryHelper<TKey, TVal>.GetHelper(); + QueryHelper<TKey, TVal> qh = QueryHelper<TKey, TVal>.GetHelper(CacheHelper<TKey, TVal>.DCache); int numSet = 0; int setSize = 0; if (objectType != null && objectType == "Portfolio") @@ -1053,7 +1052,7 @@ namespace Apache.Geode.Client.FwkLib int numOfKeys = GetUIntValue(EntryCount); FwkTest<TKey, TVal>.CurrentTest.ResetKey(ValueSizes); int objSize = GetUIntValue(ValueSizes); - QueryHelper<TKey, TVal> qh = QueryHelper<TKey, TVal>.GetHelper(); + QueryHelper<TKey, TVal> qh = QueryHelper<TKey, TVal>.GetHelper(CacheHelper<TKey, TVal>.DCache); int numSet = 0; int setSize = 0; if (objType != null && objType == "Portfolio") @@ -1171,7 +1170,7 @@ namespace Apache.Geode.Client.FwkLib { FwkTest<TKey, TVal>.CurrentTest.ResetKey(EntryCount); int numOfKeys = GetUIntValue(EntryCount); - QueryHelper<TKey, TVal> qh = QueryHelper<TKey, TVal>.GetHelper(); + QueryHelper<TKey, TVal> qh = QueryHelper<TKey, TVal>.GetHelper(CacheHelper<TKey, TVal>.DCache); int setSize = qh.PortfolioSetSize; if (numOfKeys < setSize) { @@ -1251,7 +1250,7 @@ namespace Apache.Geode.Client.FwkLib { Int32 numSet = 0; Int32 setSize = 0; - QueryHelper<TKey, TVal> qh = QueryHelper<TKey, TVal>.GetHelper(); + QueryHelper<TKey, TVal> qh = QueryHelper<TKey, TVal>.GetHelper(CacheHelper<TKey, TVal>.DCache); TVal port; setSize = qh.PortfolioSetSize; numSet = 200 / setSize; @@ -2177,9 +2176,8 @@ namespace Apache.Geode.Client.FwkLib int sleepMS = 2000; FwkInfo("Waiting for a period of silence for " + desiredSilenceSec + " seconds..."); long desiredSilenceMS = desiredSilenceSec * 1000; - DateTime startTime = DateTime.Now; - long silenceStartTime = SmokePerf<TKey, TVal>.GetDateTimeMillis(startTime); - long currentTime = SmokePerf<TKey, TVal>.GetDateTimeMillis(startTime); + long silenceStartTime = DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond; + long currentTime = DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond; long lastEventTime = (long)Util.BBGet("ListenerBB", "lastEventTime"); while (currentTime - silenceStartTime < desiredSilenceMS) @@ -2198,8 +2196,7 @@ namespace Apache.Geode.Client.FwkLib // restart the wait silenceStartTime = lastEventTime; } - startTime = DateTime.Now; - currentTime = SmokePerf<TKey, TVal>.GetDateTimeMillis(startTime); + currentTime = DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond; } long duration = currentTime - silenceStartTime; FwkInfo("Done waiting, clients have been silent for " + duration + " ms"); http://git-wip-us.apache.org/repos/asf/geode-native/blob/da389793/src/tests/cli/NewFwkLib/PerfTest/PerfTests.cs ---------------------------------------------------------------------- diff --git a/src/tests/cli/NewFwkLib/PerfTest/PerfTests.cs b/src/tests/cli/NewFwkLib/PerfTest/PerfTests.cs index 1e98555..3081f67 100644 --- a/src/tests/cli/NewFwkLib/PerfTest/PerfTests.cs +++ b/src/tests/cli/NewFwkLib/PerfTest/PerfTests.cs @@ -1119,7 +1119,7 @@ namespace Apache.Geode.Client.FwkLib isReceiveValues = GetBoolValue("receiveValue"); } region.GetSubscriptionService().RegisterKeys(registerKeyList, isDurable, isGetInitialValues, isReceiveValues); - String durableClientId = DistributedSystem.SystemProperties.DurableClientId; + String durableClientId = CacheHelper<TKey, TVal>.DCache.DistributedSystem.SystemProperties.DurableClientId; if (durableClientId.Length > 0) { CacheHelper<TKey, TVal>.DCache.ReadyForEvents(); @@ -1150,7 +1150,7 @@ namespace Apache.Geode.Client.FwkLib isReceiveValues = GetBoolValue("receiveValue"); } region.GetSubscriptionService().RegisterAllKeys(isDurable, null, isGetInitialValues,isReceiveValues); - String durableClientId = DistributedSystem.SystemProperties.DurableClientId; + String durableClientId = CacheHelper<TKey, TVal>.DCache.DistributedSystem.SystemProperties.DurableClientId; if (durableClientId.Length > 0) { CacheHelper<TKey, TVal>.DCache.ReadyForEvents(); @@ -1244,7 +1244,7 @@ namespace Apache.Geode.Client.FwkLib isReceiveValues = GetBoolValue("receiveValue"); } region.GetSubscriptionService().RegisterRegex(regex, isDurable, null, isGetInitialValues, isReceiveValues); - String durableClientId = DistributedSystem.SystemProperties.DurableClientId; + String durableClientId = CacheHelper<TKey, TVal>.DCache.DistributedSystem.SystemProperties.DurableClientId; if (durableClientId.Length > 0) { CacheHelper<TKey, TVal>.DCache.ReadyForEvents(); @@ -1359,8 +1359,8 @@ namespace Apache.Geode.Client.FwkLib Int32 eventAfterUpdate = (Int32)Util.BBGet("ConflationCacheListener", "AFTER_UPDATE_COUNT_" + Util.ClientId + "_" + region.Name); FwkInfo("DoValidateQConflation() -- eventAfterCreate {0} and eventAfterUpdate {1}", eventAfterCreate, eventAfterUpdate); - String conflateEvent = DistributedSystem.SystemProperties.ConflateEvents; - String durableClientId = DistributedSystem.SystemProperties.DurableClientId; + String conflateEvent = CacheHelper<TKey, TVal>.DCache.DistributedSystem.SystemProperties.ConflateEvents; + String durableClientId = CacheHelper<TKey, TVal>.DCache.DistributedSystem.SystemProperties.DurableClientId; Int32 totalCount = 3500; if(durableClientId.Length > 0) { FwkInfo("DoValidateQConflation() Validation for Durable client ."); http://git-wip-us.apache.org/repos/asf/geode-native/blob/da389793/src/tests/cli/NewFwkLib/QueryTest/QueryTests.cs ---------------------------------------------------------------------- diff --git a/src/tests/cli/NewFwkLib/QueryTest/QueryTests.cs b/src/tests/cli/NewFwkLib/QueryTest/QueryTests.cs index ef11454..e6f5dd6 100644 --- a/src/tests/cli/NewFwkLib/QueryTest/QueryTests.cs +++ b/src/tests/cli/NewFwkLib/QueryTest/QueryTests.cs @@ -223,7 +223,7 @@ namespace Apache.Geode.Client.FwkLib ResetKey(DistinctKeys); numOfKeys = GetUIntValue(DistinctKeys); } - QueryHelper<TKey,TVal> qh = QueryHelper<TKey,TVal>.GetHelper(); + QueryHelper<TKey,TVal> qh = QueryHelper<TKey,TVal>.GetHelper(CacheHelper<TKey, TVal>.DCache); int setSize = qh.PortfolioSetSize; FwkInfo("QueryTests.VerifyResultSet: numOfKeys [{0}], setSize [{1}].", numOfKeys, setSize); @@ -404,7 +404,7 @@ namespace Apache.Geode.Client.FwkLib ResetKey(DistinctKeys); numOfKeys = GetUIntValue(DistinctKeys); } - QueryHelper<TKey, TVal> qh = QueryHelper<TKey, TVal>.GetHelper(); + QueryHelper<TKey, TVal> qh = QueryHelper<TKey, TVal>.GetHelper(CacheHelper<TKey, TVal>.DCache); int setSize = qh.PortfolioSetSize; FwkInfo("QueryTests.VerifyStructSet: numOfKeys [{0}], setSize [{1}].", numOfKeys, setSize); @@ -629,7 +629,6 @@ namespace Apache.Geode.Client.FwkLib bool isDC = GetBoolValue("isDurable"); RegionFactory rootAttrs = null; string m_isPool = null; - //RegionAttributes rootAttrs = GetRegionAttributes(rootRegionData); // Check if this is a thin-client region; if so set the endpoints int redundancyLevel = 0; if (endpoints != null && endpoints.Length > 0) @@ -691,11 +690,11 @@ namespace Apache.Geode.Client.FwkLib if (!isObjectRegistered) { { - Serializable.RegisterTypeGeneric(Portfolio.CreateDeserializable); + Serializable.RegisterTypeGeneric(Portfolio.CreateDeserializable, CacheHelper<TKey, TVal>.DCache); FwkInfo("Completed Portfolio registeration"); } { - Serializable.RegisterTypeGeneric(Position.CreateDeserializable); + Serializable.RegisterTypeGeneric(Position.CreateDeserializable, CacheHelper<TKey, TVal>.DCache); Serializable.RegisterPdxType(PortfolioPdx.CreateDeserializable); Serializable.RegisterPdxType(PositionPdx.CreateDeserializable); FwkInfo("Completed other object registeration"); @@ -1396,8 +1395,8 @@ namespace Apache.Geode.Client.FwkLib if (isTypeRegistered != "registered") { FwkInfo("Getting inside for registeration"); - Serializable.RegisterTypeGeneric(Position.CreateDeserializable); - Serializable.RegisterTypeGeneric(Portfolio.CreateDeserializable); + Serializable.RegisterTypeGeneric(Position.CreateDeserializable, CacheHelper<TKey, TVal>.DCache); + Serializable.RegisterTypeGeneric(Portfolio.CreateDeserializable, CacheHelper<TKey, TVal>.DCache); Serializable.RegisterPdxType(Apache.Geode.Client.Tests.PortfolioPdx.CreateDeserializable); Serializable.RegisterPdxType(Apache.Geode.Client.Tests.PositionPdx.CreateDeserializable); @@ -1461,7 +1460,7 @@ namespace Apache.Geode.Client.FwkLib //string label = CacheHelper<TKey, TVal>.RegionTag(region.Attributes); ResetKey(DistinctKeys); int numOfKeys = GetUIntValue(DistinctKeys); - QueryHelper<TKey, TVal> qh = QueryHelper<TKey, TVal>.GetHelper(); + QueryHelper<TKey, TVal> qh = QueryHelper<TKey, TVal>.GetHelper(CacheHelper<TKey, TVal>.DCache); string objectType = GetStringValue(ObjectType); int setSize = qh.PortfolioSetSize; int destroyKeys = GetUIntValue(DestroyKeys); @@ -1504,7 +1503,7 @@ namespace Apache.Geode.Client.FwkLib //string label = CacheHelper<TKey, TVal>.RegionTag(region.Attributes); ResetKey(DistinctKeys); int numOfKeys = GetUIntValue(DistinctKeys); - QueryHelper<TKey, TVal> qh = QueryHelper<TKey, TVal>.GetHelper(); + QueryHelper<TKey, TVal> qh = QueryHelper<TKey, TVal>.GetHelper(CacheHelper<TKey, TVal>.DCache); string objectType = GetStringValue(ObjectType); int setSize = qh.PortfolioSetSize; int invalidateKeys = GetUIntValue(InvalidateKeys); @@ -1548,7 +1547,7 @@ namespace Apache.Geode.Client.FwkLib //string label = CacheHelper<TKey, TVal>.RegionTag(region.Attributes); ResetKey(DistinctKeys); int numOfKeys = GetUIntValue(DistinctKeys); // number of keys should be multiple of 20 - QueryHelper<TKey, TVal> qh = QueryHelper<TKey, TVal>.GetHelper(); + QueryHelper<TKey, TVal> qh = QueryHelper<TKey, TVal>.GetHelper(CacheHelper<TKey, TVal>.DCache); int numSet = 0; int setSize = 0; // Loop over value sizes @@ -1633,7 +1632,7 @@ namespace Apache.Geode.Client.FwkLib int numOfKeys = GetUIntValue(DistinctKeys); string objectType = GetStringValue(ObjectType); - QueryHelper<TKey, TVal> qh = QueryHelper<TKey, TVal>.GetHelper(); + QueryHelper<TKey, TVal> qh = QueryHelper<TKey, TVal>.GetHelper(CacheHelper<TKey, TVal>.DCache); int setSize = qh.PortfolioSetSize; if (numOfKeys < setSize) { @@ -1730,7 +1729,7 @@ namespace Apache.Geode.Client.FwkLib { try { - QueryHelper<TKey, TVal> qh = QueryHelper<TKey, TVal>.GetHelper(); + QueryHelper<TKey, TVal> qh = QueryHelper<TKey, TVal>.GetHelper(CacheHelper<TKey, TVal>.DCache); int numSet = 0; int setSize = 0; //populating data @@ -1828,7 +1827,7 @@ namespace Apache.Geode.Client.FwkLib int rangeStart = GetUIntValue("range-start"); int rangeEnd = GetUIntValue("range-end"); - QueryHelper<TKey, TVal> qh = QueryHelper<TKey, TVal>.GetHelper(); + QueryHelper<TKey, TVal> qh = QueryHelper<TKey, TVal>.GetHelper(CacheHelper<TKey, TVal>.DCache); if (m_istransaction) { txManager = CacheHelper<TKey, TVal>.DCache.CacheTransactionManager; @@ -1857,7 +1856,7 @@ namespace Apache.Geode.Client.FwkLib int rangeStart = GetUIntValue("range-start"); int rangeEnd = GetUIntValue("range-end"); - QueryHelper<TKey, TVal> qh = QueryHelper<TKey, TVal>.GetHelper(); + QueryHelper<TKey, TVal> qh = QueryHelper<TKey, TVal>.GetHelper(CacheHelper<TKey, TVal>.DCache); for (int i = rangeStart; i <= rangeEnd; i++) { @@ -1894,7 +1893,7 @@ namespace Apache.Geode.Client.FwkLib endTime = endTime.AddSeconds(secondsToRun); IRegion<TKey, TVal> region = GetRegion(); - QueryHelper<TKey, TVal> qh = QueryHelper<TKey, TVal>.GetHelper(); + QueryHelper<TKey, TVal> qh = QueryHelper<TKey, TVal>.GetHelper(CacheHelper<TKey, TVal>.DCache); while (nowTime < endTime) { @@ -1917,7 +1916,7 @@ namespace Apache.Geode.Client.FwkLib { int maxRange = GetUIntValue("range-max"); IRegion<TKey, TVal> region = GetRegion(); - QueryHelper<TKey, TVal> qh = QueryHelper<TKey, TVal>.GetHelper(); + QueryHelper<TKey, TVal> qh = QueryHelper<TKey, TVal>.GetHelper(CacheHelper<TKey, TVal>.DCache); for (int i = 1; i <= maxRange; i++) { http://git-wip-us.apache.org/repos/asf/geode-native/blob/da389793/src/tests/cli/NewFwkLib/SecurityTest/Security.cs ---------------------------------------------------------------------- diff --git a/src/tests/cli/NewFwkLib/SecurityTest/Security.cs b/src/tests/cli/NewFwkLib/SecurityTest/Security.cs index 10555c0..05124e4 100644 --- a/src/tests/cli/NewFwkLib/SecurityTest/Security.cs +++ b/src/tests/cli/NewFwkLib/SecurityTest/Security.cs @@ -135,7 +135,7 @@ namespace Apache.Geode.Client.FwkLib DateTime startTime; DateTime endTime; TimeSpan elapsedTime; - QueryService qs = CacheHelper.DCache.GetQueryService(); + QueryService qs = CacheHelper<TKey, TVal>.DCache.GetQueryService(); ResetKey(LargeSetQuery); ResetKey(UnsupportedPRQuery); bool isLargeSetQuery = GetBoolValue(LargeSetQuery); http://git-wip-us.apache.org/repos/asf/geode-native/blob/da389793/src/tests/cli/NewFwkLib/SmokePerf/ObjectHelper.cs ---------------------------------------------------------------------- diff --git a/src/tests/cli/NewFwkLib/SmokePerf/ObjectHelper.cs b/src/tests/cli/NewFwkLib/SmokePerf/ObjectHelper.cs deleted file mode 100644 index c0f395d..0000000 --- a/src/tests/cli/NewFwkLib/SmokePerf/ObjectHelper.cs +++ /dev/null @@ -1,73 +0,0 @@ -/* - * 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. - */ - -using System; -using System.Collections.Generic; -using System.Text; -using System.Threading; -using Apache.Geode.Client.Tests; -namespace Apache.Geode.Client.FwkLib -{ - using Apache.Geode.DUnitFramework; - using Apache.Geode.Client; - public class ObjectHelper<TKey, TVal> - { - public static TVal CreateObject(string objectname, Int32 size, bool encodeKey, bool encodeTimestamp, - Int32 assetSize,Int32 maxVal ,Int32 idx) { - - if (objectname.Equals("ArrayOfByte")) - { - return (TVal)(object)ArrayOfByte.Init(size,encodeKey,encodeTimestamp); - } - else if(objectname.Equals("BatchObject")) - { - return (TVal)(object) new BatchObject(idx, assetSize, size); - } - - else if (objectname.Equals("PSTObject")) - { - return (TVal)(object) new PSTObject(size, encodeKey, encodeTimestamp); - } - else if(objectname.Equals("FastAssetAccount")) - { - return (TVal)(object) new FastAssetAccount(idx, encodeTimestamp, maxVal, assetSize); - } - else if (objectname.Equals("DeltaFastAssetAccount")) - { - return (TVal)(object) new DeltaFastAssetAccount(idx, encodeTimestamp, maxVal, assetSize, encodeKey); - } - else if (objectname == "EqStruct") - { - return (TVal)(object) new EqStruct(idx); - } - else if (objectname.Equals("DeltaPSTObject")) - { - return (TVal)(object)new DeltaPSTObject(size, encodeKey, encodeTimestamp); - } - else { - Int32 bufSize = size; - byte[] buf = new byte[bufSize]; - for (int i = 0; i < bufSize; i++) - { - buf[i] = 123; - } - Int32 rsiz = (bufSize <= 10) ? bufSize : 10; - return (TVal)(object)buf; - } - } - } -} http://git-wip-us.apache.org/repos/asf/geode-native/blob/da389793/src/tests/cli/NewFwkLib/SmokePerf/PerfStat.cs ---------------------------------------------------------------------- diff --git a/src/tests/cli/NewFwkLib/SmokePerf/PerfStat.cs b/src/tests/cli/NewFwkLib/SmokePerf/PerfStat.cs deleted file mode 100644 index 7b6f15b..0000000 --- a/src/tests/cli/NewFwkLib/SmokePerf/PerfStat.cs +++ /dev/null @@ -1,295 +0,0 @@ -/* - * 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. - */ - -using System; -using System.Collections.Generic; -using System.Text; -using System.Threading; -using Apache.Geode.Client.Tests; -using Apache.Geode.DUnitFramework; -namespace Apache.Geode.Client.FwkLib -{ - using Apache.Geode.Client; - public static class PerfOps { - public const string PERF_CREATES = "creates"; - public const string PERF_CREATE_TIME = "createTime"; - public const string PERF_PUTS="puts"; - public const string PERF_PUT_TIME="putTime"; - public const string PERF_UPDATE_EVENTS="updateEvents"; - public const string PERF_UPDATE_LATENCY="updateLatency"; - public const string PERF_LATENCY_SPIKES = "latencySpikes"; - public const string PERF_NEGATIVE_LATENCIES = "negativeLatencies"; - public const string PERF_OPS = "operations"; - public const string PERF_OP_TIME = "operationTime"; - public const string PERF_CONNECTS = "connects"; - public const string PERF_CONNECT_TIME = "connectTime"; - public const string PERF_DISCONNECTS = "disconnects"; - public const string PERF_DISCONNECT_TIME = "disconnectTime"; - public const string PERF_GETS = "gets"; - public const string PERF_GET_TIME = "getTime"; - public const string PERF_QUERIES = "queries"; - public const string PERF_QUERY_TIME = "queryTime"; - public const string PERF_UPDATES = "updates"; - public const string PERF_UPDATES_TIME = "updateTime"; - } - public class PerfStat - { - private Statistics testStat; - private StatisticsType statsType; - private long ReturnTime() - { - DateTime startTime = DateTime.Now; - //Stopwatch System.Diagnostics.Stopwatch; - - return startTime.Ticks * (1000000 / TimeSpan.TicksPerMillisecond); - } - public PerfStat(int threadID) - { - PerfStatType regStatType = PerfStatType.GetInstance(); - statsType = regStatType.GetStatType(); - StatisticsFactory factory = StatisticsFactory.GetExistingInstance(); - string buf = String.Format("ThreadId-{0}", threadID); - testStat = factory.CreateStatistics(statsType, buf); - } - public long StartCreate() - { - return ReturnTime(); - } - public void EndCreate(long start, bool isMainWorkload) - { - EndCreate(start, 1, isMainWorkload); - } - public void EndCreate(long start, int amount, bool isMainWorkload) - { - long elapsed = ReturnTime() - start; - if (isMainWorkload) - { - testStat.IncInt(statsType.NameToId(PerfOps.PERF_OPS), amount); - testStat.IncLong(statsType.NameToId(PerfOps.PERF_OP_TIME), elapsed); - } - testStat.IncInt(statsType.NameToId(PerfOps.PERF_CREATES), amount); - testStat.IncLong(statsType.NameToId(PerfOps.PERF_CREATE_TIME), elapsed); - } - public long StartPut() - { - return ReturnTime(); - } - public void EndPut(long start, bool isMainWorkload) - { - EndPut(start, 1, isMainWorkload); - } - public void EndPut(long start, int amount, bool isMainWorkload) - { - long elapsed = ReturnTime() - start; - if(isMainWorkload){ - testStat.IncInt(statsType.NameToId(PerfOps.PERF_OPS), amount); - testStat.IncLong(statsType.NameToId(PerfOps.PERF_OP_TIME), elapsed); - } - testStat.IncInt(statsType.NameToId(PerfOps.PERF_PUTS), amount); - testStat.IncLong(statsType.NameToId(PerfOps.PERF_PUT_TIME), elapsed); - } - public long StartGet() - { - return ReturnTime(); - } - public void EndGet(long start, bool isMainWorkload) - { - EndGet(start,1,isMainWorkload); - } - public void EndGet(long start, int amount, bool isMainWorkload) - { - long elapsed = ReturnTime() - start; - if(isMainWorkload){ - testStat.IncInt(statsType.NameToId(PerfOps.PERF_OPS), amount); - testStat.IncLong(statsType.NameToId(PerfOps.PERF_OP_TIME), elapsed); - } - testStat.IncInt(statsType.NameToId(PerfOps.PERF_GETS), amount); - testStat.IncLong(statsType.NameToId(PerfOps.PERF_GET_TIME), elapsed); - } - public void Close(){ - testStat.Close(); - } - public void IncUpdateLatency(long amount) - { - long nonZeroAmount = amount; - if (nonZeroAmount == 0) { // make non-zero to ensure non-flatline - nonZeroAmount = 1; // nanosecond - } - testStat.IncInt(statsType.NameToId(PerfOps.PERF_UPDATE_EVENTS), 1); - testStat.IncLong(statsType.NameToId(PerfOps.PERF_UPDATE_LATENCY), nonZeroAmount); - } - - public void IncLatencySpikes(int amount) - { - testStat.IncInt(statsType.NameToId(PerfOps.PERF_LATENCY_SPIKES), amount); - } - - public void IncNegativeLatencies(int amount) - { - testStat.IncInt(statsType.NameToId(PerfOps.PERF_NEGATIVE_LATENCIES), amount); - } - public void SetOps(int amount) - { - testStat.SetInt(statsType.NameToId(PerfOps.PERF_OPS), amount); - } - public void SetOpTime(long amount) - { - testStat.SetLong(statsType.NameToId(PerfOps.PERF_OP_TIME), amount); - } - public long StartConnect() - { - return ReturnTime(); - } - public void EndConnect(long start, bool isMainWorkload) - { - long elapsed = ReturnTime() - start; - if(isMainWorkload){ - testStat.IncInt(statsType.NameToId(PerfOps.PERF_OPS), 1); - testStat.IncLong(statsType.NameToId(PerfOps.PERF_OP_TIME), elapsed); - } - testStat.IncInt(statsType.NameToId(PerfOps.PERF_CONNECTS), 1); - testStat.IncLong(statsType.NameToId(PerfOps.PERF_CONNECT_TIME), elapsed); - } - public Int64 GetConnectTime() - { - return testStat.GetLong(PerfOps.PERF_CONNECT_TIME); - } - public long StartQuery() - { - return ReturnTime(); - } - public void EndQuery(long start, bool isMainWorkload) - { - EndQuery(start,1,isMainWorkload); - } - public void EndQuery(long start, int amount, bool isMainWorkload) - { - long elapsed = ReturnTime() - start; - if(isMainWorkload){ - testStat.IncInt(statsType.NameToId(PerfOps.PERF_OPS), amount); - testStat.IncLong(statsType.NameToId(PerfOps.PERF_OP_TIME), elapsed); - } - testStat.IncInt(statsType.NameToId(PerfOps.PERF_QUERIES), amount); - testStat.IncLong(statsType.NameToId(PerfOps.PERF_QUERY_TIME), elapsed); - } - public void IncUpdateEvents(int amount) - { - testStat.IncInt(statsType.NameToId(PerfOps.PERF_UPDATE_EVENTS), amount); - } - public int GetOps() - { - return testStat.GetInt(PerfOps.PERF_OPS); - } - /** - * @return the timestamp that marks the start of the update - */ - public long StartUpdate() - { - return ReturnTime(); - } - public void EndUpdate(long start, bool isMainWorkload) - { - EndUpdate(start, 1, isMainWorkload); - } - public void EndUpdate(long start, int amount, bool isMainWorkload) - { - long elapsed = ReturnTime() - start; - if (isMainWorkload) { - testStat.IncInt(statsType.NameToId(PerfOps.PERF_OPS), amount); - testStat.IncLong(statsType.NameToId(PerfOps.PERF_OP_TIME), elapsed); - } - testStat.IncInt(statsType.NameToId(PerfOps.PERF_UPDATES), amount); - testStat.IncLong(statsType.NameToId(PerfOps.PERF_UPDATES_TIME), elapsed); - } - } - public class PerfStatType - { - private static PerfStatType single = null; - private StatisticDescriptor[] statDes = new StatisticDescriptor[20]; - private PerfStatType() - { - } - public static PerfStatType GetInstance() - { - if(single == null) - { - single = new PerfStatType(); - } - return single; - } - public StatisticsType GetStatType() - { - StatisticsFactory m_factory = StatisticsFactory.GetExistingInstance(); - StatisticsType statsType = m_factory.FindType("cacheperf.CachePerfStats"); - if (statsType == null) - { - statDes[0] = m_factory.CreateIntCounter(PerfOps.PERF_PUTS, "Number of puts completed.", "operations", 1); - statDes[1] = m_factory.CreateLongCounter(PerfOps.PERF_PUT_TIME, - "Total time spent doing puts.", "nanoseconds", 0); - statDes[2] = m_factory.CreateIntCounter(PerfOps.PERF_UPDATE_EVENTS, - "Number of update events.", "events", 1); - statDes[3] = m_factory.CreateLongCounter(PerfOps.PERF_UPDATE_LATENCY, - "Latency of update operations.", "nanoseconds", 0); - statDes[4] = m_factory.CreateIntCounter(PerfOps.PERF_CREATES, - "Number of creates completed.", "operations", 1); - statDes[5] = m_factory.CreateLongCounter(PerfOps.PERF_CREATE_TIME, - "Total time spent doing creates.", "nanoseconds", 0); - statDes[6] = m_factory.CreateIntCounter(PerfOps.PERF_LATENCY_SPIKES, - "Number of latency spikes.", "spikes", 0); - statDes[7] - = m_factory.CreateIntCounter( - PerfOps.PERF_NEGATIVE_LATENCIES, - "Number of negative latencies (caused by insufficient clock skew correction).", - "negatives", 0); - statDes[8] = m_factory.CreateIntCounter(PerfOps.PERF_OPS, - "Number of operations completed.", "operations", 1); - statDes[9] = m_factory.CreateLongCounter(PerfOps.PERF_OP_TIME, - "Total time spent doing operations.", "nanoseconds", 0); - statDes[10] = m_factory.CreateIntCounter(PerfOps.PERF_CONNECTS, - "Number of connects completed.", "operations", 1); - statDes[11] = m_factory.CreateLongCounter(PerfOps.PERF_CONNECT_TIME, - "Total time spent doing connects.", "nanoseconds", 0); - statDes[12] = m_factory.CreateIntCounter(PerfOps.PERF_DISCONNECTS, - "Number of disconnects completed.", "operations", 1); - statDes[13] = m_factory.CreateLongCounter(PerfOps.PERF_DISCONNECT_TIME, - "Total time spent doing disconnects.", "nanoseconds", 0); - statDes[14] = m_factory.CreateIntCounter(PerfOps.PERF_GETS, - "Number of gets completed.", "operations", 1); - statDes[15] = m_factory.CreateLongCounter(PerfOps.PERF_GET_TIME, - "Total time spent doing gets.", "nanoseconds", 0); - statDes[16] = m_factory.CreateIntCounter(PerfOps.PERF_QUERIES, - "Number of queries completed.", "operations", 1); - statDes[17] = m_factory.CreateLongCounter(PerfOps.PERF_QUERY_TIME, - "Total time spent doing queries.", "nanoseconds", 0); - statDes[18] = m_factory.CreateIntCounter(PerfOps.PERF_UPDATES, - "Number of updates completed.", "operations", 1); - statDes[19] = m_factory.CreateLongCounter(PerfOps.PERF_UPDATES_TIME, - "Total time spent doing updates.", "nanoseconds", 0); - statsType = m_factory.CreateType("cacheperf.CachePerfStats", "Application statistics.", statDes, 20); - } - return statsType; - } - public static void Clean() - { - if (single != null) - { - single = null; - } - } - - } -}