Package com.yahoo.ycsb

Examples of com.yahoo.ycsb.StringByteIterator


    try {
      final ODocument document = dictionary.get(key);
      if (document != null) {
        if (fields != null)
          for (String field : fields)
            result.put(field, new StringByteIterator((String) document.field(field)));
        else
          for (String field : document.fieldNames())
            result.put(field, new StringByteIterator((String) document.field(field)));
        return 0;
      }
    } catch (Exception e) {
      e.printStackTrace();
    }
View Full Code Here


      for (ODocument document : documents) {
        final HashMap<String, ByteIterator> entry = new HashMap<String, ByteIterator>(fields.size());
        result.add(entry);

        for (String field : fields)
          entry.put(field, new StringByteIterator((String) document.field(field)));
      }

      return 0;
    } catch (Exception e) {
      e.printStackTrace();
View Full Code Here

        System.out.println("update");
        int i;
        HashMap<String, ByteIterator> newValues = new HashMap<String, ByteIterator>(10);

        for (i = 1; i <= 10; i++) {
            newValues.put("field" + i, new StringByteIterator("newvalue" + i));
        }

        int expResult = 0;
        int result = instance.update(MOCK_TABLE, MOCK_KEY1, newValues);
        assertEquals(expResult, result);
View Full Code Here

            logger.error(e);
            System.exit(0);
        }

        HashMap<String, ByteIterator> vals = new HashMap<String, ByteIterator>();
        vals.put("age", new StringByteIterator("57"));
        vals.put("middlename", new StringByteIterator("bradley"));
        vals.put("favoritecolor", new StringByteIterator("blue"));
        int res = cli.insert("usertable", "BrianFrankCooper", vals);
        System.out.println("Result of insert: " + res);

        HashMap<String, ByteIterator> result = new HashMap<String, ByteIterator>();
        HashSet<String> fields = new HashSet<String>();
View Full Code Here

            e.printStackTrace();
            System.exit(0);
        }

        HashMap<String, ByteIterator> vals = new HashMap<String, ByteIterator>();
        vals.put("age", new StringByteIterator("57"));
        vals.put("middlename", new StringByteIterator("bradley"));
        vals.put("favoritecolor", new StringByteIterator("blue"));
        int res = cli.insert("usertable", "BrianFrankCooper", vals);
        System.out.println("Result of insert: " + res);

        HashMap<String, ByteIterator> result = new HashMap<String, ByteIterator>();
        HashSet<String> fields = new HashSet<String>();
View Full Code Here

            e.printStackTrace();
            System.exit(0);
        }

        HashMap<String, ByteIterator> vals = new HashMap<String, ByteIterator>();
        vals.put("age", new StringByteIterator("57"));
        vals.put("middlename", new StringByteIterator("bradley"));
        vals.put("favoritecolor", new StringByteIterator("blue"));
        int res = cli.insert("usertable", "BrianFrankCooper", vals);
        System.out.println("Result of insert: " + res);

        HashMap<String, ByteIterator> result = new HashMap<String, ByteIterator>();
        HashSet<String> fields = new HashSet<String>();
View Full Code Here

            logger.error(e);
            System.exit(0);
        }

        HashMap<String, ByteIterator> vals = new HashMap<String, ByteIterator>();
        vals.put("age", new StringByteIterator("57"));
        vals.put("middlename", new StringByteIterator("bradley"));
        vals.put("favoritecolor", new StringByteIterator("blue"));
        int res = cli.insert("usertable", "BrianFrankCooper", vals);
        System.out.println("Result of insert: " + res);

        HashMap<String, ByteIterator> result = new HashMap<String, ByteIterator>();
        HashSet<String> fields = new HashSet<String>();
View Full Code Here

                    logger.error(e);
                    System.exit(0);
                }

                HashMap<String, ByteIterator> vals = new HashMap<String, ByteIterator>();
                vals.put("age", new StringByteIterator("57"));
                vals.put("middlename", new StringByteIterator("bradley"));
                vals.put("favoritecolor", new StringByteIterator("blue"));
                int res = cli.insert("usertable", "BrianFrankCooper", vals);
               
                cli.read("usertable", "BrianFrankCooper", null, null);
                System.out.println("Result of insert: " + res);
                try
View Full Code Here

            Iterator<String> fieldIterator = fields.iterator();
            Iterator<String> valueIterator = values.iterator();

            while (fieldIterator.hasNext() && valueIterator.hasNext())
            {
                result.put(fieldIterator.next(), new StringByteIterator(valueIterator.next()));
            }
            assert !fieldIterator.hasNext() && !valueIterator.hasNext();
        }
        return result.isEmpty() ? 1 : 0;
    }
View Full Code Here

            e.printStackTrace();
            System.exit(0);
        }

        HashMap<String, ByteIterator> vals = new HashMap<String, ByteIterator>();
        vals.put("age", new StringByteIterator("57"));
        vals.put("middlename", new StringByteIterator("bradley"));
        vals.put("favoritecolor", new StringByteIterator("blue"));
        int res = cli.insert("usertable", "BrianFrankCooper", vals);
        System.out.println("Result of insert: " + res);

        HashMap<String, ByteIterator> result = new HashMap<String, ByteIterator>();
        HashSet<String> fields = new HashSet<String>();
View Full Code Here

TOP

Related Classes of com.yahoo.ycsb.StringByteIterator

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.