Package com.alvazan.orm.api.z8spi.conv

Examples of com.alvazan.orm.api.z8spi.conv.ByteArray


    IndexColumnInfo info = new IndexColumnInfo();   
   
    if(cachedFromRightResults.hasNext()) {
      //We need to compare lastCachedRightSide with our incoming to make see if they pair up
      //or else move to the next right side answer.
      ByteArray pkOfRightView = lastCachedRightSide.getPrimaryKey(rightView);
      ByteArray valueOfLeft = new ByteArray(indCol.getIndexedValue());
      if(!valueOfLeft.equals(pkOfRightView)) {
        lastCachedRightSide = cachedFromRightResults.next();
      }   
 
      info.mergeResults(lastCachedRightSide);
    }
View Full Code Here


      Set<String> fieldSet = row.keySet();
      //String fromField = StandardConverters.convertToString(from);
      //String toField = StandardConverters.convertToString(to);
      //String fromField = StandardConverters.convertFromBytes(String.class, from);
      //String toField = StandardConverters.convertFromBytes(String.class, to);
      ByteArray fromField = new ByteArray(from);
      ByteArray toField = new ByteArray(to);
     
/*      for (String field : fieldSet) {       
        if(!field.equalsIgnoreCase("_id")) {
          byte[] name = StandardConverters.convertFromString(byte[].class, field);
          ByteArray fieldname = new ByteArray(name);
View Full Code Here

    List<KeyValue<Row>> finalRes = new ArrayList<KeyValue<Row>>();
    Iterator<byte[]> keyIter = keysToLookup.iterator();
    for (RowHolder<Row> r : results) {
      if (r == null) {
        byte[] key = keyIter.next();
        ByteArray b = new ByteArray(key);
        KeyValue<Row> kv = map.get(b);
        if (kv!=null)
          finalRes.add(kv);
      } else {
        Row row = r.getValue();
View Full Code Here

    List<KeyValue<Row>> finalRes = new ArrayList<KeyValue<Row>>();
    Iterator<byte[]> keyIter = keysToLookup.iterator();
    for (RowHolder<Row> r : results) {
      if (r == null) {
        byte[] key = keyIter.next();
        ByteArray b = new ByteArray(key);
        KeyValue<Row> kv = map.get(b);
        if (kv != null)
          finalRes.add(kv);
      } else {
        Row row = r.getValue();
View Full Code Here

        if (cursor == null) {
            for (byte[] key : keysToLookup) {
                KeyValue<Row> kv = new KeyValue<Row>();
                kv.setKey(key);
                kv.setValue(null);
                ByteArray b = new ByteArray(key);
                map.put(b, kv);
                cache.cacheRow(cf, key, kv.getValue());
            }
        } else {
            fillCacheForCursor(map, cursor, keysToLookup);
View Full Code Here

                if (val.length != 0)
                    c.setValue(val);
                r.put(c);

                kv.setValue(r);
                ByteArray b = new ByteArray(cqlRowKey);
                map.put(b, kv);
                cache.cacheRow(cf, cqlRowKey, kv.getValue());
            }
        }

        // Now put the remaining keys which are not in CQL3's cursor.
        // This is because Cassandra returns all the rows with rowkeys while CQL# doesn't
        for (byte[] key : keysToLookup) {
            ByteArray baKey = new ByteArray(key);
            if (!map.containsKey(baKey)) {
                KeyValue<Row> kv = new KeyValue<Row>();
                kv.setKey(key);
                kv.setValue(null);
                // ByteArray b = new ByteArray(key);
View Full Code Here

    List<KeyValue<Row>> finalRes = new ArrayList<KeyValue<Row>>();
    Iterator<byte[]> keyIter = keysToLookup.iterator();
    for (RowHolder<Row> r : results) {
      if (r == null) {
        byte[] key = keyIter.next();
        ByteArray b = new ByteArray(key);
        KeyValue<Row> kv = map.get(b);
        if (kv!=null)
          finalRes.add(kv);
      } else {
        Row row = r.getValue();
View Full Code Here

    List<KeyValue<Row>> finalRes = new ArrayList<KeyValue<Row>>();
    Iterator<byte[]> keyIter = keysToLookup.iterator();
    for (RowHolder<Row> r : results) {
      if (r == null) {
        byte[] key = keyIter.next();
        ByteArray b = new ByteArray(key);
        KeyValue<Row> kv = map.get(b);
        if (kv != null)
          finalRes.add(kv);
      } else {
        Row row = r.getValue();
View Full Code Here

    if (cursor.size() == 0) {
      for (byte[] key : keysToLookup) {
        KeyValue<Row> kv = new KeyValue<Row>();
        kv.setKey(key);
        kv.setValue(null);
        ByteArray b = new ByteArray(key);
        map.put(b, kv);
        cache.cacheRow(cf, key, kv.getValue());
      }
    } else {
      while (cursor.hasNext()) {
        DBObject mdbrow = cursor.next();
        KeyValue<Row> kv = new KeyValue<Row>();
        byte[] mdbRowKey = StandardConverters.convertToBytes(mdbrow
            .get("_id"));
        kv.setKey(mdbRowKey);

        if (!mdbrow.keySet().isEmpty()) {
          Row r = rowProvider.get();
          r.setKey(mdbRowKey);
          MongoDbUtil.processColumns(mdbrow, r);
          kv.setValue(r);
        }
        ByteArray b = new ByteArray(mdbRowKey);
        map.put(b, kv);
        cache.cacheRow(cf, mdbRowKey, kv.getValue());
      }
      // Now put the remaining keys which are not in MongoDB's cursor.
      // This is because Cassandra returns all the rows with rowkeys while Mongodb doesn't
      for (byte[] key : keysToLookup) {
        ByteArray baKey = new ByteArray(key);
        if (!map.containsKey(baKey)) {
          KeyValue<Row> kv = new KeyValue<Row>();
          kv.setKey(key);
          kv.setValue(null);
          // ByteArray b = new ByteArray(key);
View Full Code Here

  public Wrapper getIndexNode(ViewInfo view) {
    return colNameToValue.get(view);
  }

  public ByteArray getPrimaryKey(ViewInfo leftView) {
    return new ByteArray(getPrimaryKeyRaw(leftView));
  }
View Full Code Here

TOP

Related Classes of com.alvazan.orm.api.z8spi.conv.ByteArray

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.