@@ -0,0 +1,1621 @@
+/*%0A * Copyright 2015 The Mashub Project%0A *%0A * The Mashub Project licenses this file to you under the Apache License,%0A * version 2.0 (the %22License%22); you may not use this file except in compliance%0A * with the License. You may obtain a copy of the License at:%0A *%0A *   http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS, WITHOUT%0A * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the%0A * License for the specific language governing permissions and limitations%0A * under the License.%0A */%0A%0Apackage com.beatsbucket.mashub.store;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.HashMap;%0Aimport java.util.List;%0A%0A/**%0A * Use local memory as database. It is volatile. %0A *%0A */%0Apublic class LocalMemoryStorage extends LocalStorage %7B%0A%0A%09public static HashMap%3CString,List%3CString%3E%3E cache = new HashMap%3CString,List%3CString%3E%3E();%0A%09%0A%09public LocalMemoryStorage() %7B%0A%09%09// TODO Auto-generated constructor stub%0A%09%7D%0A%0A%09/* (non-Javadoc)%0A%09 * @see com.beatsbucket.mashub.store.Storable#read(java.lang.Object)%0A%09 */%0A%09@Override%0A%09public List%3CString%3E read(String k) %7B%0A%09%09// TODO Auto-generated method stub%0A%09%09return cache.get(k);%0A%09%7D%0A%0A%09/* (non-Javadoc)%0A%09 * @see com.beatsbucket.mashub.store.Storable#write(java.lang.Object, java.lang.Object)%0A%09 */%0A%09@Override%0A%09public void write(String k, String v) %7B%0A%09%09// TODO Auto-generated method stub%0A%09%09if(cache.get(k) == null) %7B%0A%09%09%09ArrayList%3CString%3E theList = new ArrayList%3CString%3E();%0A%09%09%09theList.add(v);%0A%09%09%09cache.put(k, theList);%0A%09%09%7D else %7B%0A%09%09%09cache.get(k).add(v);%0A%09%09%7D%0A%09%7D%09%0A%7D%0A

Add local memory storage.