appmetr / hercules Goto Github PK
View Code? Open in Web Editor NEWNEW LOCATION: https://github.pixapi.net/appmetr/hercules
Home Page: http://appmetr.github.io/hercules
License: MIT License
NEW LOCATION: https://github.pixapi.net/appmetr/hercules
Home Page: http://appmetr.github.io/hercules
License: MIT License
При этом сохранить (и, скорее всего, обновить тоже) их можно. Проблема чисто в том, как работает чтение. См. com.appmetr.hercules.driver.ThriftDataDriver#getSlice(me.prettyprint.hector.api.Keyspace, java.lang.String, com.appmetr.hercules.profile.DataOperationsProfile, com.appmetr.hercules.driver.serializer.RowSerializer<R,T>, R, com.appmetr.hercules.wide.SliceDataSpecificator<T>)
:
public class ThriftDataDriver implements DataDriver {
...
@Override
public <R, T> HerculesQueryResult<T> getSlice(Keyspace keyspace, String columnFamily, DataOperationsProfile dataOperationsProfile, RowSerializer<R, T> rowSerializer, R rowKey, SliceDataSpecificator<T> sliceDataSpecificator) {
HerculesMultiQueryResult<R, T> queryResult = getSlice(keyspace, columnFamily, dataOperationsProfile, rowSerializer, Arrays.asList(rowKey), sliceDataSpecificator);
if (queryResult.hasResult() && queryResult.containsKey(rowKey)) {
return new HerculesQueryResult<T>(queryResult.getEntries().get(rowKey));
}
return new HerculesQueryResult<T>();
}
...
}
com.appmetr.hercules.driver.HerculesMultiQueryResult#containsKey
:
public class HerculesMultiQueryResult<R, T> {
private LinkedHashMap<R, LinkedHashMap<T, Object>> entries = new LinkedHashMap<R, LinkedHashMap<T, Object>>();
...
public Boolean containsKey(R rowKey) {
return entries.containsKey(rowKey);
}
...
}
Очевидно, что когда R
- это byte[]
, HashMap#containsKey(R)
вернет результат только если аргумент и ключ - это один и тот же экземпляр byte[]
. В нашем же случае аргумент - это объект, переданный пользователем в метод Dao#get()
, а ключ - это объект, полученный при десериализации результатов запроса.
Спасибо @HaveNuIdea и @igorskikh за проведенное расследование.
It throws IllegalArgument "Can not set null to " upon loading already persisted entities.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.