Search in sources :

Example 86 with TObject

use of com.cinchapi.concourse.thrift.TObject in project concourse by cinchapi.

the class StoreTest method testBrowseRecordAfterRemove.

@Test
public void testBrowseRecordAfterRemove() {
    Multimap<String, TObject> data = Variables.register("data", HashMultimap.<String, TObject>create());
    long record = TestData.getLong();
    for (String key : getKeys()) {
        for (int i = 0; i < TestData.getScaleCount() % 4; i++) {
            TObject value = TestData.getTObject();
            if (!data.containsEntry(key, value)) {
                data.put(key, value);
                add(key, value, record);
            }
        }
    }
    Iterator<Entry<String, TObject>> it = data.entries().iterator();
    while (it.hasNext()) {
        Entry<String, TObject> entry = it.next();
        if (TestData.getScaleCount() % 3 == 0) {
            it.remove();
            remove(entry.getKey(), entry.getValue(), record);
        }
    }
    Assert.assertEquals(data.asMap(), store.select(record));
}
Also used : TObject(com.cinchapi.concourse.thrift.TObject) Entry(java.util.Map.Entry) ConcourseBaseTest(com.cinchapi.concourse.test.ConcourseBaseTest) Test(org.junit.Test)

Example 87 with TObject

use of com.cinchapi.concourse.thrift.TObject in project concourse by cinchapi.

the class StoreTest method testDescribeAfterAddAndRemoveSingle.

@Test
public void testDescribeAfterAddAndRemoveSingle() {
    String key = TestData.getSimpleString();
    TObject value = TestData.getTObject();
    long record = TestData.getLong();
    add(key, value, record);
    remove(key, value, record);
    Assert.assertFalse(store.describe(record).contains(key));
}
Also used : TObject(com.cinchapi.concourse.thrift.TObject) ConcourseBaseTest(com.cinchapi.concourse.test.ConcourseBaseTest) Test(org.junit.Test)

Example 88 with TObject

use of com.cinchapi.concourse.thrift.TObject in project concourse by cinchapi.

the class StoreTest method testBrowseKeyAfterRemove.

@Test
public void testBrowseKeyAfterRemove() {
    Multimap<TObject, Long> data = Variables.register("data", TreeMultimap.<TObject, Long>create());
    String key = TestData.getSimpleString();
    for (TObject value : getValues()) {
        for (int i = 0; i < TestData.getScaleCount() % 4; i++) {
            long record = TestData.getLong();
            if (!data.containsEntry(value, record)) {
                data.put(value, record);
                add(key, value, record);
            }
        }
    }
    Iterator<Entry<TObject, Long>> it = data.entries().iterator();
    while (it.hasNext()) {
        Entry<TObject, Long> entry = it.next();
        if (TestData.getScaleCount() % 3 == 0) {
            it.remove();
            remove(key, entry.getKey(), entry.getValue());
        }
    }
    Assert.assertEquals(data.asMap(), store.browse(key));
}
Also used : TObject(com.cinchapi.concourse.thrift.TObject) Entry(java.util.Map.Entry) ConcourseBaseTest(com.cinchapi.concourse.test.ConcourseBaseTest) Test(org.junit.Test)

Example 89 with TObject

use of com.cinchapi.concourse.thrift.TObject in project concourse by cinchapi.

the class StoreTest method testFetchAfterAddSingleWithTime.

@Test
public void testFetchAfterAddSingleWithTime() {
    String key = TestData.getSimpleString();
    TObject value = TestData.getTObject();
    long record = TestData.getLong();
    long timestamp = Time.now();
    add(key, value, record);
    Assert.assertFalse(store.select(key, record, timestamp).contains(value));
}
Also used : TObject(com.cinchapi.concourse.thrift.TObject) ConcourseBaseTest(com.cinchapi.concourse.test.ConcourseBaseTest) Test(org.junit.Test)

Example 90 with TObject

use of com.cinchapi.concourse.thrift.TObject in project concourse by cinchapi.

the class StoreTest method testFetchAfterAddSingle.

@Test
public void testFetchAfterAddSingle() {
    String key = TestData.getSimpleString();
    TObject value = TestData.getTObject();
    long record = TestData.getLong();
    add(key, value, record);
    Assert.assertTrue(store.select(key, record).contains(value));
}
Also used : TObject(com.cinchapi.concourse.thrift.TObject) ConcourseBaseTest(com.cinchapi.concourse.test.ConcourseBaseTest) Test(org.junit.Test)

Aggregations

TObject (com.cinchapi.concourse.thrift.TObject)242 Test (org.junit.Test)100 ComplexTObject (com.cinchapi.concourse.thrift.ComplexTObject)98 Set (java.util.Set)98 AtomicSupport (com.cinchapi.concourse.server.storage.AtomicSupport)96 TranslateClientExceptions (com.cinchapi.concourse.server.aop.TranslateClientExceptions)91 VerifyAccessToken (com.cinchapi.concourse.server.aop.VerifyAccessToken)91 VerifyReadPermission (com.cinchapi.concourse.server.aop.VerifyReadPermission)88 Map (java.util.Map)76 AbstractSyntaxTree (com.cinchapi.ccl.syntax.AbstractSyntaxTree)72 SortableTable (com.cinchapi.concourse.data.sort.SortableTable)71 Store (com.cinchapi.concourse.server.storage.Store)66 Order (com.cinchapi.concourse.lang.sort.Order)63 SortableColumn (com.cinchapi.concourse.data.sort.SortableColumn)61 SortableSet (com.cinchapi.concourse.data.sort.SortableSet)60 ByteBuffer (java.nio.ByteBuffer)60 Operator (com.cinchapi.concourse.thrift.Operator)59 Entry (java.util.Map.Entry)59 Convert (com.cinchapi.concourse.util.Convert)57 Sets (com.google.common.collect.Sets)57