/******************************************************************************* * 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(); } }