Comments (3)
Well, the original idea was that flipByte() ensures that there's always at least 2 free words in the array (and thus we don't need to call expandCheck inside the writeLong). Since all the longs are at most 64 bits long and we should always have >= 65 bits free in the array. Can you provide a test scenario where this check fails?
from gorilla-tsc.
Here's a main method that runs into out of bounds exception.
`
public static void main(String args[]) {
long now = System.currentTimeMillis();
LongArrayOutput output = new LongArrayOutput(500);
GorillaCompressor c = new GorillaCompressor(LocalDateTime.now(ZoneOffset.UTC).truncatedTo(ChronoUnit.HOURS).
toInstant(ZoneOffset.UTC).toEpochMilli(), output);
Map<Long, Double> dps = new TreeMap<>();
int n = 3600;
Random r = new Random();
for(int i=0; i<n; i++) {
dps.put(now + (1000 * i) + r.nextInt(100), 100.0);
}
for(Map.Entry<Long, Double> entry : dps.entrySet()) {
c.addValue(entry.getKey(), entry.getValue());
}
c.close();
LongArrayInput input = new LongArrayInput(output.getLongArray());
GorillaDecompressor dc = new GorillaDecompressor(input);
while(true) {
Pair pair = dc.readPair();
if(pair == null)
break;
if(!dps.containsKey(pair.getTimestamp())) {
System.out.println("There was a mismatch.");
}
}
System.out.println("Done.");
}
`
from gorilla-tsc.
Fixed in 2.0.1
from gorilla-tsc.
Related Issues (15)
- Fix travis issues
- Allow compressing and retrieving long values
- Support use of only timestamp or value compression HOT 1
- Support splitIterator in Decompressor
- Don't write end stream
- Incorrect Maven dependency HOT 1
- Move benchmarks to test part HOT 2
- Reconsider ZigZag for storing longs
- Ability to use DFCM predictor HOT 1
- Create copy constructors for LongArrayOutput and ByteBufferBitOutput
- Gorilla style compression HOT 3
- Why must values be inserted in the increasing time order HOT 2
- Enforce positive timestamps and maximal gaps HOT 1
- Still being maintained? And a few PRs if so HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gorilla-tsc.