Package oracle.kv

Examples of oracle.kv.Key


    return update(table, key, values);
  }

  @Override
  public int delete(String table, String key) {
    Key kvKey = createKey(table, key);
    try {
      store.multiDelete(kvKey, null, null);
    } catch (FaultException e) {
      System.err.println(e);
      return ERROR;
View Full Code Here


    return key.getMinorPath().get(0);
  }

  @Override
  public int read(String table, String key, Set<String> fields, HashMap<String, ByteIterator> result) {
    Key kvKey = createKey(table, key);
    SortedMap<Key, ValueVersion> kvResult;
    try {
      kvResult = store.multiGet(kvKey, null, null);
    } catch (FaultException e) {
      System.err.println(e);
View Full Code Here

  }

  @Override
  public int update(String table, String key, HashMap<String, ByteIterator> values) {
    for (Map.Entry<String, ByteIterator> entry : values.entrySet()) {
      Key kvKey = createKey(table, key, entry.getKey());
      Value kvValue = Value.createValue(entry.getValue().toArray());
      try {
        store.put(kvKey, kvValue);
      } catch (FaultException e) {
        System.err.println(e);
View Full Code Here

            majorKeyComponents.add(column);
            majorKeyComponents.add(PropertyAccessorHelper.getString(valueObject));

            String minorKey = PropertyAccessorHelper.getString(id);

            Key key = Key.createKey(majorKeyComponents, minorKey);
            byte[] valueByteArray = PropertyAccessorHelper.getBytes(id);

            kvStore.put(key, Value.createValue(valueByteArray));
        }
    }
View Full Code Here

        List<String> majorComponents = new ArrayList<String>();
        majorComponents.add(secIndexName);
        majorComponents.add(parentIdColumnName);
        majorComponents.add(id);

        Key majorKeyToFind = Key.createKey(majorComponents);

        Iterator<KeyValueVersion> iterator = kvStore.multiGetIterator(Direction.FORWARD, 0, majorKeyToFind, null, null);

        Map<String, Object> results = new HashMap<String, Object>();
View Full Code Here

                    Iterator<KeyValueVersion> iterator = null;

                    if (condition.equals("="))
                    {
                        majorComponents.add(PropertyAccessorHelper.getString(value));
                        Key majorKeyToFind = Key.createKey(majorComponents);
                        iterator = kvStore.multiGetIterator(Direction.FORWARD, 0, majorKeyToFind, range, null);
                    }
                    else if (condition.equals(">"))
                    {
                        range = new KeyRange(value.toString(), false, null, true);
                        Key majorKeyToFind = Key.createKey(majorComponents);
                        iterator = kvStore.storeIterator(Direction.UNORDERED, 0, majorKeyToFind, range, null);
                    }
                    else if (condition.equals("<"))
                    {
                        range = new KeyRange(null, true, value.toString(), false);
                        Key majorKeyToFind = Key.createKey(majorComponents);
                        iterator = kvStore.storeIterator(Direction.UNORDERED, 0, majorKeyToFind, range, null);
                    }
                    else if (condition.equals(">="))
                    {
                        range = new KeyRange(value.toString(), true, null, true);
                        Key majorKeyToFind = Key.createKey(majorComponents);
                        iterator = kvStore.storeIterator(Direction.UNORDERED, 0, majorKeyToFind, range, null);
                    }
                    else if (condition.equals("<="))
                    {
                        range = new KeyRange(null, true, value.toString(), true);
                        Key majorKeyToFind = Key.createKey(majorComponents);
                        iterator = kvStore.storeIterator(Direction.UNORDERED, 0, majorKeyToFind, range, null);
                    }

                    while (iterator.hasNext())
                    {
View Full Code Here

                List<String> majorComponents = new ArrayList<String>();
                majorComponents.add(indexTableName);
                majorComponents.add(columnName);

                Key key = Key.createKey(majorComponents);
                Iterator<KeyValueVersion> iterator = kvStore.storeIterator(Direction.UNORDERED, 0, key, null, null);

                while (iterator.hasNext())
                {
                    KeyValueVersion keyValueVersion = iterator.next();
                    Key keytoDelete = keyValueVersion.getKey();
                    byte[] value = keyValueVersion.getValue().getValue();
                    Object valueObject = PropertyAccessorHelper.getObject(
                            ((AbstractAttribute) entityMetadata.getIdAttribute()).getBindableJavaType(), value);

                    if (valueObject.equals(id))
View Full Code Here

        }
    }

    private void addOps(Map<Key, List<TableOperation>> operations, Table schemaTable, Row row)
    {
        Key key = ((TableImpl) schemaTable).createKey(row, false);

        TableOperation ops = tableAPI.getTableOperationFactory().createPut(row, Choice.NONE, true);

        if (operations.containsKey(key))
        {
View Full Code Here

    public int read(String table, String key, Set<String> fields, HashMap<String, ByteIterator> result)
    {
        List<String> majorComponents = new ArrayList<String>();
        majorComponents.add(table);
        majorComponents.add(key);
        Key kvKey = Key.createKey(majorComponents);
        Iterator<KeyValueVersion> iterator;
        try
        {
            iterator = store.multiGetIterator(Direction.FORWARD, 0, kvKey, null, null);
        }
View Full Code Here

        majorKeyComponent.add(table);
        majorKeyComponent.add(key); // Major

        for (Map.Entry<String, ByteIterator> entry : values.entrySet())
        {
            Key kvKey = Key.createKey(majorKeyComponent, entry.getKey());
            Value kvValue = Value.createValue(entry.getValue().toArray());
            try
            {
                Operation op = store.getOperationFactory().createPut(kvKey, kvValue);
                persistOperations.add(op);
View Full Code Here

TOP

Related Classes of oracle.kv.Key

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.