पर ये चंदा वहीं है और तारे वहीं ही।
बस सपनो में होंगी बदलती सी चाहें,
खड़ा था जहाँ मैं, खड़ा हूँ वहीं ही।
Disclaimer: Thoughts expressed are mine and my only. Why would it be anybody's else? Anyone using the blogs without citing my name is liable for legal action. इस ब्लॉग में सभी पोस्ट्स मेरी स्वयं की रचनाएँ हैं जो कोम्मोंस कॉपीराईट द्वारा सुरक्षित हैं। जो उद्धहरण दूसरों से लिए गए हैं वह या तो कोटेड हैं या उनके मूल रचनाकारों या प्रोडक्ट्स के नाम उद्धत हैं।
Posted by
Ashish
at
9:57 PM
1 comments
Labels: personal
Posted by
Ashish
at
11:36 PM
0
comments
Labels: Cricket
Posted by
Ashish
at
9:32 PM
0
comments
Labels: coherence
Posted by
Ashish
at
2:14 AM
0
comments
Labels: coherence, ece, Elastic Charging Engine
Posted by
Ashish
at
2:59 AM
0
comments
Posted by
Ashish
at
12:11 PM
0
comments
Labels: personal
Posted by
Ashish
at
9:12 PM
0
comments
public interface NoSQLKeyAssociation extends KeyAssociation {
String getRootKey();
}
public abstract class PartitionAwareNoSQLCacheStore extends AbstractCacheStore
{
private KVStore kvStore;
public PartitionAwareNoSQLCacheStore(String kvServers) {
KVStoreConfig kvStoreConfig = new KVStoreConfig("addressStore", kvServers);
kvStoreConfig.setConsistency(Consistency.NONE_REQUIRED);
kvStore = KVStoreFactory.getStore(kvStoreConfig);
}
@Override
public void store(Object key, Object value) {
storeAll(Collections.singletonMap(key, value));
}
@Override
public void storeAll(Map map) {
Map<NoSQLKeyAssociation, Object> transformedMap = transformer(map);
Set<Map.Entry<NoSQLKeyAssociation,Object>> set;
set = transformedMap.entrySet();
ArrayList majorComponents;
ArrayList minorComponents;
for (Map.Entry entry : set) {
majorComponents = new ArrayList();
minorComponents = new ArrayList();
NoSQLKeyAssociation associationKey = entry.getKey();
majorComponents.add((String)associationKey.getAssociatedKey());
minorComponents.add(associationKey.getRootKey());
Key key = Key.createKey(majorComponents, minorComponents);
byte [] bytes = ExternalizableHelper.toByteArray(entry.getValue())
kvStore.put(key, Value.createValue(bytes));
}
}
public abstract Map transformer(Map entries);
}
The method transformer( ) allows for the Cache Store's concrete class to either transform the Map entries in some form or return the Map as is if the keys are already of type NoSQLKeyAssociation. If not this method gives an opportunity to convert the key to a type of NoSQLKeyAssociation, for one.
Posted by
Ashish
at
6:52 AM
0
comments
Posted by
Ashish
at
3:34 PM
0
comments
