Beispiel #1
0
            private Tuple <GroupCache, bool> GetCache(TGroupKey key)
            {
                var cache = _allGroupings.Lookup(key);

                if (cache.HasValue)
                {
                    return(Tuple.Create(cache.Value, false));
                }

                var newcache = new GroupCache(key);

                _allGroupings[key] = newcache;
                return(Tuple.Create(newcache, true));
            }
Beispiel #2
0
 internal EncodingIdMapper(NumberArrayFactory cacheFactory, Encoder encoder, Factory <Radix> radixFactory, Monitor monitor, TrackerFactory trackerFactory, Groups groups, System.Func <long, CollisionValues> collisionValuesFactory, int chunkSize, int processorsForParallelWork, Comparator comparator)
 {
     this._radixFactory              = radixFactory;
     this._monitor                   = monitor;
     this._cacheFactory              = cacheFactory;
     this._trackerFactory            = trackerFactory;
     this._collisionValuesFactory    = collisionValuesFactory;
     this._comparator                = comparator;
     this._processorsForParallelWork = max(processorsForParallelWork, 1);
     this._dataCache                 = cacheFactory.NewDynamicLongArray(chunkSize, GAP_VALUE);
     this._groupCache                = GroupCache.select(cacheFactory, chunkSize, groups.Size());
     this._groups  = groups;
     this._encoder = encoder;
     this._radix   = radixFactory.NewInstance();
 }
Beispiel #3
0
        /// <summary>
        /// Is called by SimPe (through the Wrapper) when the Panel is going to be displayed, so
        /// you should updatet the Data displayed by the Panel with the Attributes stored in the
        /// passed Wrapper.
        /// </summary>
        /// <param name="wrapper">The Attributes of this Wrapper have to be displayed</param>
        public void UpdateGUI(IFileWrapper wrapper)
        {
            //form.wrapper = (IFileWrapperSaveExtension)wrapper;
            GroupCache wrp = (GroupCache)wrapper;

            form.lbgroup.BeginUpdate();
            form.lbgroup.Items.Clear();
            form.lbgroup.Sorted = false;
            foreach (GroupCacheItem i in wrp.Items)
            {
                form.lbgroup.Items.Add(i);
            }
            form.lbgroup.Sorted = true;
            form.lbgroup.EndUpdate();
        }
Beispiel #4
0
        public async Task InitializeAsync(string orgName)
        {
            Tickets = await TicketCache.QueryAsync(orgName);

            Contacts = await ContactCache.QueryAsync(orgName);

            ContactDictionary = Contacts.ToDictionary(row => row.Id);

            Companies = await CompanyCache.QueryAsync(orgName);

            CompanyDictionary = Companies.ToDictionary(row => row.Id);

            Groups = await GroupCache.QueryAsync(orgName);

            GroupDictionary = Groups.ToDictionary(row => row.Id);
        }
Beispiel #5
0
 private void MultiThreadTestWorker(object obj)
 {
     for (int n = 0; n&lt; 10; n++)
     {
         for (int m = 0; m&lt; 25; m++)
         {
             using (RowObject row
                        = GroupCache.GetGroupCache(n).GetCachedItem(m))
             {
                 row.Property1 = string.Format("{0} {1} {2}", obj, n, m);
                 Thread.Sleep(3);
             }
         }
     }
     Interlocked.Increment(ref _threadFinishedCount);
 }
Beispiel #6
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldHandleSingleByteCount()
        public virtual void ShouldHandleSingleByteCount()
        {
            // given
            int        max   = 256;
            GroupCache cache = GroupCache.select(HEAP, 100, max);

            // when
            AssertSetAndGet(cache, 10, 45);
            AssertSetAndGet(cache, 100, 145);
            AssertSetAndGet(cache, 1000, 245);

            // then
            try
            {
                cache.Set(10000, 345);
                fail("Shouldn't handle that");
            }
            catch (ArithmeticException)
            {
                // OK
            }
        }
Beispiel #7
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldSwitchToTwoByteVersionBeyondSingleByteGroupIds()
        public virtual void ShouldSwitchToTwoByteVersionBeyondSingleByteGroupIds()
        {
            // given
            int        max   = 257;
            GroupCache cache = GroupCache.select(HEAP, 100, max);

            // when
            AssertSetAndGet(cache, 10, 123);
            AssertSetAndGet(cache, 100, 1234);
            AssertSetAndGet(cache, 1000, 12345);
            AssertSetAndGet(cache, 10000, 0xFFFF);

            // then
            try
            {
                cache.Set(100000, 123456);
                fail("Shouldn't handle that");
            }
            catch (ArithmeticException)
            {
                // OK
            }
        }
Beispiel #8
0
 private void AssertSetAndGet(GroupCache cache, long nodeId, int groupId)
 {
     cache.Set(nodeId, groupId);
 }
        /// <summary>
        /// Clear all caches contained in this manager.
        /// </summary>
        public static void Clear()
        {
            if (m_AllocatedGeometryObjectCache != null)
                m_AllocatedGeometryObjectCache.DisposeCache();
            ParameterUtil.ClearParameterCache();

            m_AllocatedGeometryObjectCache = null;
            m_AreaSchemeCache = null;
            m_AssemblyInstanceCache = null;
            m_BeamSystemCache = null;
            m_CategoryClassNameCache = null;
            m_CategoryTypeCache = null;
            m_CeilingSpaceRelCache = null;
            m_ClassificationCache = null;
            m_ClassificationLocationCache = null;
            m_ConditionalPropertySetsForTypeCache = null;
            m_ContainmentCache = null;
            m_CurveAnnotationCache = null;
            m_DBViewsToExport = null;
            m_DefaultCartesianTransformationOperator3D = null;
            m_DoorWindowDelayedOpeningCreatorCache = null;
            m_DummyHostCache = null;
            m_ElementToHandleCache = null;
            m_ElementsInAssembliesCache = null;
            m_ExportOptionsCache = null;
            m_FabricAreaHandleCache = null;
            m_GridCache = null;
            m_GroupCache = null;
            m_GroupElementGeometryCache = null;
            m_GUIDCache = null;
            m_GUIDsToStoreCache = null;
            m_HandleToElementCache = null;
            m_HostObjectsLevelIndex = null;
            m_HostPartsCache = null;
            m_IsExternalParameterValueCache = null;
            m_LevelInfoCache = null;
            m_MaterialIdToStyleHandleCache = null;
            m_MaterialLayerRelationsCache = null;
            m_MaterialLayerSetCache = null;
            m_MaterialHandleCache = null;
            m_MaterialRelationsCache = null;
            m_MEPCache = null;
            m_ParameterCache = null;
            m_PartExportedCache = null;
            m_PresentationLayerSetCache = null;
            m_PresentationStyleCache = null;
            m_PropertyInfoCache = null;
            m_PropertyMapCache = null;
            m_PropertySetsForTypeCache = null;
            m_RailingCache = null;
            m_RailingSubElementCache = null;
            m_SpaceBoundaryCache = null;
            m_SpaceInfoCache = null;
            m_SpaceOccupantInfoCache = null;
            m_StairRampContainerInfoCache = null;
            m_SystemsCache = null;
            m_TrussCache = null;
            m_TypeObjectsCache = null;
            m_TypePropertyInfoCache = null;
            m_TypeRelationsCache = null;
            m_ViewScheduleElementCache = null;
            m_WallConnectionDataCache = null;
            m_WallTypeCache = null;
            m_UnitsCache = null;
            m_ZoneCache = null;
            m_ZoneInfoCache = null;
        }
 public WonkaRefGroup GetGroupByGroupName(string psGroupName)
 {
     return(GroupCache.Where(x => x.GroupName == psGroupName).FirstOrDefault());
 }
Beispiel #11
0
 private static IGrouping <TObject, TKey, TGroupKey> GetGroupState(GroupCache grouping)
 {
     return(new ImmutableGroup <TObject, TKey, TGroupKey>(grouping.Key, grouping.Cache));
 }
Beispiel #12
0
        public void ApplyGrouping(LogColumn column, object value)
        {
            GroupCache gc;
            if (!_grouping.ContainsKey(column.Ordinal))
            {
                gc = new GroupCache();

                TreeNode newRoot = new TreeNode();
                gc.RootNode = newRoot;
                newRoot.Text = column.Name;
                treeView.Nodes.Add(newRoot);
                _grouping[column.Ordinal] = gc;
            }
            else
            {
                gc = _grouping[column.Ordinal];
            }

            char separator = (char)0;

            switch (column.Grouping)
            {
                case LogColumnGrouping.Hierarchy:
                    separator = '.';
                    break;

                case LogColumnGrouping.FileSystem:
                    separator = Path.DirectorySeparatorChar;
                    break;
            }
            gc.LogEventAttributeToNode(Convert.ToString(value), gc.RootNode, separator);
        }