X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.db.procore%2Fsrc%2Forg%2Fsimantics%2Fdb%2Fprocore%2Fcluster%2FForeignTableSmall.java;fp=bundles%2Forg.simantics.db.procore%2Fsrc%2Forg%2Fsimantics%2Fdb%2Fprocore%2Fcluster%2FForeignTableSmall.java;h=49f903e4d082b454de8954bc431eb1ae2fa21874;hp=6c9db07b618f2d6e75582e4b2453aacec3184948;hb=0ae2b770234dfc3cbb18bd38f324125cf0faca07;hpb=24e2b34260f219f0d1644ca7a138894980e25b14 diff --git a/bundles/org.simantics.db.procore/src/org/simantics/db/procore/cluster/ForeignTableSmall.java b/bundles/org.simantics.db.procore/src/org/simantics/db/procore/cluster/ForeignTableSmall.java index 6c9db07b6..49f903e4d 100644 --- a/bundles/org.simantics.db.procore/src/org/simantics/db/procore/cluster/ForeignTableSmall.java +++ b/bundles/org.simantics.db.procore/src/org/simantics/db/procore/cluster/ForeignTableSmall.java @@ -1,156 +1,156 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Association for Decentralized Information Management - * in Industry THTH ry. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * VTT Technical Research Centre of Finland - initial API and implementation - *******************************************************************************/ -package org.simantics.db.procore.cluster; - -import org.simantics.db.exception.DatabaseException; -import org.simantics.db.impl.ClusterBase; -import org.simantics.db.impl.ClusterI; -import org.simantics.db.impl.ClusterI.Procedure; -import org.simantics.db.impl.ClusterSupport; -import org.simantics.db.impl.ClusterTraitsBase; -import org.simantics.db.impl.IClusterTable; -import org.simantics.db.impl.Modifier; -import org.simantics.db.impl.Table; -import org.simantics.db.impl.TableFactory; -import org.simantics.db.service.ClusterUID; -import org.simantics.db.service.ResourceUID; - -import gnu.trove.map.hash.TIntShortHashMap; - -final public class ForeignTableSmall extends Table -{ - private IClusterTable clusterTable; - public ForeignTableSmall(ClusterBase sizeListener, int[] header, int headerBase) { - super(TableFactory.getLongFactory(), sizeListener, header, headerBase); - this.clusterTable = sizeListener.getClusterTable(); - } - public ForeignTableSmall(ClusterBase sizeListener, int[] header, int headerBase, long[] longs) { - super(TableFactory.getLongFactory(), sizeListener, header, headerBase, longs); - this.clusterTable = sizeListener.getClusterTable(); - } - public int getUsedSize() { - return getTableCount(); - } - static long rmTime = 0; - public TIntShortHashMap getResourceHashMap() - throws DatabaseException { -// long start = System.nanoTime(); - int ELEMENT_SIZE = ForeignElement.getSizeOf(); - assert(ELEMENT_SIZE == 3); - final int TABLE_SIZE = getTableCount(); - final int FOREIGN_COUNT = getForeignCount(); - final int BASE = this.getTableBase(); - final int TOP = BASE + TABLE_SIZE * ELEMENT_SIZE; - long[] table = this.getTable(); - int count = 0; - int index = ZERO_SHIFT; - - long firstCache = 0; - long secondCache = 0; - int clusterKeyCache = 0; - - TIntShortHashMap hm = new TIntShortHashMap(FOREIGN_COUNT); - for (int i=BASE; i boolean foreach(int setIndex, Procedure procedure, Context context, - ClusterSupport support, Modifier modifier) throws DatabaseException { - throw new UnsupportedOperationException(); - } -} +/******************************************************************************* + * Copyright (c) 2007, 2010 Association for Decentralized Information Management + * in Industry THTH ry. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * VTT Technical Research Centre of Finland - initial API and implementation + *******************************************************************************/ +package org.simantics.db.procore.cluster; + +import org.simantics.db.exception.DatabaseException; +import org.simantics.db.impl.ClusterBase; +import org.simantics.db.impl.ClusterI; +import org.simantics.db.impl.ClusterI.Procedure; +import org.simantics.db.impl.ClusterSupport; +import org.simantics.db.impl.ClusterTraitsBase; +import org.simantics.db.impl.IClusterTable; +import org.simantics.db.impl.Modifier; +import org.simantics.db.impl.Table; +import org.simantics.db.impl.TableFactory; +import org.simantics.db.service.ClusterUID; +import org.simantics.db.service.ResourceUID; + +import gnu.trove.map.hash.TIntShortHashMap; + +final public class ForeignTableSmall extends Table +{ + private IClusterTable clusterTable; + public ForeignTableSmall(ClusterBase sizeListener, int[] header, int headerBase) { + super(TableFactory.getLongFactory(), sizeListener, header, headerBase); + this.clusterTable = sizeListener.getClusterTable(); + } + public ForeignTableSmall(ClusterBase sizeListener, int[] header, int headerBase, long[] longs) { + super(TableFactory.getLongFactory(), sizeListener, header, headerBase, longs); + this.clusterTable = sizeListener.getClusterTable(); + } + public int getUsedSize() { + return getTableCount(); + } + static long rmTime = 0; + public TIntShortHashMap getResourceHashMap() + throws DatabaseException { +// long start = System.nanoTime(); + int ELEMENT_SIZE = ForeignElement.getSizeOf(); + assert(ELEMENT_SIZE == 3); + final int TABLE_SIZE = getTableCount(); + final int FOREIGN_COUNT = getForeignCount(); + final int BASE = this.getTableBase(); + final int TOP = BASE + TABLE_SIZE * ELEMENT_SIZE; + long[] table = this.getTable(); + int count = 0; + int index = ZERO_SHIFT; + + long firstCache = 0; + long secondCache = 0; + int clusterKeyCache = 0; + + TIntShortHashMap hm = new TIntShortHashMap(FOREIGN_COUNT); + for (int i=BASE; i boolean foreach(int setIndex, Procedure procedure, Context context, + ClusterSupport support, Modifier modifier) throws DatabaseException { + throw new UnsupportedOperationException(); + } +}