Search in sources :

Example 66 with DataPoint

use of com.srotya.sidewinder.core.storage.DataPoint in project sidewinder by srotya.

the class ByzantineWriter method write.

@Override
public void write(List<DataPoint> dps) throws IOException {
    write.lock();
    try {
        for (Iterator<DataPoint> itr = dps.iterator(); itr.hasNext(); ) {
            DataPoint dp = itr.next();
            writeDataPoint(dp.getTimestamp(), dp.getLongValue());
        }
    } finally {
        write.unlock();
    }
}
Also used : DataPoint(com.srotya.sidewinder.core.storage.DataPoint)

Example 67 with DataPoint

use of com.srotya.sidewinder.core.storage.DataPoint in project sidewinder by srotya.

the class TestMiscUtils method testBuildDataPoint.

@Test
public void testBuildDataPoint() {
    DataPoint dp = MiscUtils.buildDataPoint(10L, 10.1);
    assertEquals(10L, dp.getTimestamp(), 0);
    assertEquals(10.1, dp.getValue(), 0);
    dp = MiscUtils.buildDataPoint(10L, 10L);
    assertEquals(10L, dp.getTimestamp(), 0);
    assertEquals(10, dp.getLongValue(), 0);
}
Also used : DataPoint(com.srotya.sidewinder.core.storage.DataPoint) Test(org.junit.Test)

Aggregations

DataPoint (com.srotya.sidewinder.core.storage.DataPoint)67 Test (org.junit.Test)52 Series (com.srotya.sidewinder.core.storage.Series)40 ArrayList (java.util.ArrayList)39 IOException (java.io.IOException)16 Reader (com.srotya.sidewinder.core.storage.compression.Reader)13 TimeSeries (com.srotya.sidewinder.core.storage.TimeSeries)12 ByteBuffer (java.nio.ByteBuffer)11 ReducingWindowedAggregator (com.srotya.sidewinder.core.functions.windowed.ReducingWindowedAggregator)10 HashMap (java.util.HashMap)10 LinkedHashMap (java.util.LinkedHashMap)10 RejectException (com.srotya.sidewinder.core.storage.RejectException)9 File (java.io.File)9 Point (com.srotya.sidewinder.core.rpc.Point)8 ItemNotFoundException (com.srotya.sidewinder.core.storage.ItemNotFoundException)8 List (java.util.List)8 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)6 Tag (com.srotya.sidewinder.core.filters.Tag)5 Writer (com.srotya.sidewinder.core.storage.compression.Writer)5 ByzantineWriter (com.srotya.sidewinder.core.storage.compression.byzantine.ByzantineWriter)4