public void stats() { long max = 0; for ( Object key : buckets.keys() ) { long s = buckets.get(key).size(); max = Math.max(max, s); } s_maxBucketSize = max; s_bucketCount = buckets.keys().size(); s_noKeyBucketSize = (noKeyBucket == null) ? 0 : noKeyBucket.size(); // s_count // s_maxMatchGroup // What to do with them? }
public void put(Binding row) { s_count++; Object longHash = JoinLib.hash(joinKey, row); if ( longHash == JoinLib.noKeyHash ) { noKeyBucket.add(row); return; } buckets.put(longHash, row); }
public void clear() { buckets.clear(); } }
public Iterator<Binding> getCandidates(Binding row) { Iterator<Binding> iter = null; Object longHash = JoinLib.hash(joinKey, row); if ( longHash == JoinLib.noKeyHash ) iter = buckets.values().iterator(); else { Collection<Binding> x = buckets.get(longHash); if ( x != null ) { s_maxMatchGroup = Math.max(s_maxMatchGroup, x.size()); iter = x.iterator(); } else { s_countScanMiss ++ ; } } // And the rows with no common hash key if ( noKeyBucket != null ) iter = Iter.concat(iter, noKeyBucket.iterator()); return iter; }
throw new TextIndexException("Text map entry predicate property has non resource value : " + n); mapDefs.put(field, n.asNode()) ; Collection<Node> c = mapDefs.get(defaultField) ; if ( c.isEmpty() ) throw new TextIndexException("No definition of primary field '"+defaultField+"'") ; docDef.setLangField(langField); docDef.setUidField(uniqueIdField); for ( String f : mapDefs.keys() ) { for ( Node p : mapDefs.get(f)) docDef.set(f, p) ;
accumulators.put(key, placeholder); continue; if ( !accumulators.containsKey(key) ) { for ( ExprAggregator agg : aggregators ) { Accumulator x = agg.getAggregator().createAccumulator(); Var v = agg.getVar(); accumulators.put(key, Pair.create(v, x)); for ( Pair<Var, Accumulator> pair : accumulators.get(key) ) pair.getRight().accumulate(b, execCxt); return accumulators.keySet().iterator(); for ( Binding k : accumulators.keySet() ) { Collection<Pair<Var, Accumulator>> accs = accumulators.get(k); BindingMap b = BindingFactory.create(k);
public Collection<Binding> getHashMatch$(Binding row) { Object longHash = JoinLib.hash(joinKey, row); if ( longHash == JoinLib.noKeyHash ) return noKeyBucket; Collection<Binding> list = buckets.get(longHash); return list; }
public Model export(Model result, ViewDefinition viewDef) { // Partition view definitions by graph and subject List<Quad> template = viewDef.getConstructTemplate(); Multimap<Entry<Node, Node>, Quad> gsToQuadsIndex = Multimaps.index(template, q -> new SimpleEntry<>(q.getGraph(), q.getSubject())); for(Entry<Entry<Node, Node>, Collection<Quad>> gsToQuads : gsToQuadsIndex.asMap().entrySet()) { Entry<Node, Node> key = gsToQuads.getKey(); Node g = key.getKey(); Node s = key.getValue(); Collection<Quad> quads = gsToQuads.getValue(); exportTriplesMapSameGraphAndSubject(result, viewDef, g, s, quads); } return result; }
throw new TextIndexException("Text map entry predicate property has non resource value : " + n); mapDefs.put(field, n.asNode()) ; Collection<Node> c = mapDefs.get(defaultField) ; if ( c.isEmpty() ) throw new TextIndexException("No definition of primary field '"+defaultField+"'") ; docDef.setLangField(langField); docDef.setUidField(uniqueIdField); for ( String f : mapDefs.keys() ) { for ( Node p : mapDefs.get(f)) docDef.set(f, p) ;
public Model export(Model result, ViewDefinition viewDef) { // Partition view definitions by graph and subject List<Quad> template = viewDef.getConstructTemplate(); Multimap<Entry<Node, Node>, Quad> gsToQuadsIndex = Multimaps.index(template, q -> new SimpleEntry<>(q.getGraph(), q.getSubject())); for(Entry<Entry<Node, Node>, Collection<Quad>> gsToQuads : gsToQuadsIndex.asMap().entrySet()) { Entry<Node, Node> key = gsToQuads.getKey(); Node g = key.getKey(); Node s = key.getValue(); Collection<Quad> quads = gsToQuads.getValue(); exportTriplesMapSameGraphAndSubject(result, viewDef, g, s, quads); } return result; }
/** Parse the query string - do not process the body even for a form */ public static Multimap<String, String> parseQueryString(HttpServletRequest req) { Multimap<String, String> map = ArrayListMultimap.create() ; // Don't use ServletRequest.getParameter or getParamterNames // as that reads form data. This code parses just the query string. if ( req.getQueryString() != null ) { String[] params = req.getQueryString().split("&") ; for (int i = 0; i < params.length; i++) { String p = params[i] ; String[] x = p.split("=", 2) ; String name = null ; String value = null ; if ( x.length == 0 ) { // No "=" name = p ; value = "" ; } else if ( x.length == 1 ) { // param= name = x[0] ; value = "" ; } else { // param=value name = x[0] ; value = x[1] ; } map.put(name, value) ; } } return map ; }
for(Entry<Node, Collection<Quad>> pToQuads : pToQuadsIndex.asMap().entrySet()) { Node p = pToQuads.getKey(); Collection<Quad> pQuads = pToQuads.getValue();
/** Parse the query string - do not process the body even for a form */ public static Multimap<String, String> parseQueryString(HttpServletRequest req) { Multimap<String, String> map = ArrayListMultimap.create() ; // Don't use ServletRequest.getParameter or getParamterNames // as that reads form data. This code parses just the query string. if ( req.getQueryString() != null ) { String[] params = req.getQueryString().split("&") ; for (int i = 0; i < params.length; i++) { String p = params[i] ; String[] x = p.split("=", 2) ; String name = null ; String value = null ; if ( x.length == 0 ) { // No "=" name = p ; value = "" ; } else if ( x.length == 1 ) { // param= name = x[0] ; value = "" ; } else { // param=value name = x[0] ; value = x[1] ; } map.put(name, value) ; } } return map ; }
for(Entry<Node, Collection<Quad>> pToQuads : pToQuadsIndex.asMap().entrySet()) { Node p = pToQuads.getKey(); Collection<Quad> pQuads = pToQuads.getValue();