Package com.carrotsearch.hppc

Examples of com.carrotsearch.hppc.LongArrayList


    private final LongArrayList mapKeysInCurrentTx;
    private final LongProcedure newTransactionProcedure;

    public LongIDVertexCache() {
        map = new LongObjectOpenHashMap<>(AbstractIDVertexCache.INITIAL_CAPACITY);
        mapKeysInCurrentTx = new LongArrayList(AbstractIDVertexCache.INITIAL_TX_CAPACITY);
        newTransactionProcedure = new VertexConverterLP();
    }
View Full Code Here


    private final LongArrayList mapKeysInCurrentTx;
    private final LongProcedure newTransactionProcedure;

    public LongIDVertexCache() {
        map = new LongObjectOpenHashMap<Object>(AbstractIDVertexCache.INITIAL_CAPACITY);
        mapKeysInCurrentTx = new LongArrayList(AbstractIDVertexCache.INITIAL_TX_CAPACITY);
        newTransactionProcedure = new VertexConverterLP();
    }
View Full Code Here

        builder.addAllVertices(vertices);
        return builder;
    }

    public void executeMultiQuery(final Collection<InternalVertex> vertices, final SliceQuery sq) {
        LongArrayList vids = new LongArrayList(vertices.size());
        for (InternalVertex v : vertices) {
            if (!v.isNew() && v.hasId() && (v instanceof CacheVertex) && !v.hasLoadedRelations(sq)) vids.add(v.getID());
        }

        if (!vids.isEmpty()) {
            List<List<Entry>> results = graph.edgeMultiQuery(vids, sq, txHandle);
            int pos = 0;
            for (TitanVertex v : vertices) {
                if (pos<vids.size() && vids.get(pos) == v.getID()) {
                    final List<Entry> vresults = results.get(pos);
                    ((CacheVertex) v).loadRelations(sq, new Retriever<SliceQuery, List<Entry>>() {
                        @Override
                        public List<Entry> get(SliceQuery query) {
                            return vresults;
View Full Code Here

        LongSet writtenTypes = new LongOpenHashSet(sortKey.length + signature.length);
        if (sortKey.length > 0 || signature.length > 0) {
            for (long id : sortKey) writtenTypes.add(id);
            for (long id : signature) writtenTypes.add(id);
        }
        LongArrayList remainingTypes = new LongArrayList(8);
        for (TitanType t : relation.getPropertyKeysDirect()) {
            if (!writtenTypes.contains(t.getID())) {
                remainingTypes.add(t.getID());

            }
        }
        //Sort types before writing to ensure that value is always written the same way
        long[] remaining = remainingTypes.toArray();
        Arrays.sort(remaining);
        for (long tid : remaining) {
            TitanType t = tx.getExistingType(tid);
            writeInline(writer, t, relation.getProperty(t), true);
        }
View Full Code Here

        private final LongArrayList values;

        public CustomLongNumericDocValuesField(String  name, long value) {
            super(name);
            values = new LongArrayList();
            add(value);
        }
View Full Code Here

            }
        } else {
            List<String> types = new ArrayList<>(size);
            List<String> ids = new ArrayList<>(size);
            List<String[]> fields = new ArrayList<>(size);
            LongArrayList versions = new LongArrayList(size);
            List<VersionType> versionTypes = new ArrayList<>(size);
            List<FetchSourceContext> fetchSourceContexts = new ArrayList<>(size);

            for (int i = 0; i < size; i++) {
                locations.add(in.readVInt());
                if (in.readBoolean()) {
                    types.add(in.readSharedString());
                } else {
                    types.add(null);
                }
                ids.add(in.readString());
                int size1 = in.readVInt();
                if (size1 > 0) {
                    String[] fieldsArray = new String[size1];
                    for (int j = 0; j < size1; j++) {
                        fieldsArray[j] = in.readString();
                    }
                    fields.add(fieldsArray);
                } else {
                    fields.add(null);
                }
                versions.add(Versions.readVersionWithVLongForBW(in));
                versionTypes.add(VersionType.fromValue(in.readByte()));

                fetchSourceContexts.add(FetchSourceContext.optionalReadFromStream(in));
            }

            for (int i = 0; i < size; i++) {
                //before 1.4 we have only one index, the concrete one
                MultiGetRequest.Item item = new MultiGetRequest.Item(index, types.get(i), ids.get(i))
                        .fields(fields.get(i)).version(versions.get(i)).versionType(versionTypes.get(i))
                        .fetchSourceContext(fetchSourceContexts.get(i));
                items.add(item);
            }
        }
View Full Code Here

TOP

Related Classes of com.carrotsearch.hppc.LongArrayList

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.