@Test public void put() throws FailStoreException { Job job = new Job(); job.setTaskId("2131232"); for (int i = 0; i < 100; i++) { failStore.put(key + "" + i, job); } System.out.println("这里debug测试多线程"); failStore.close(); }
@Override public void put(String key, Object value) throws FailStoreException { try { String valueString = JSON.toJSONString(value); assert valueString != null; db.put(key.getBytes("UTF-8"), valueString.getBytes("UTF-8")); } catch (Exception e) { throw new FailStoreException(e); } }
LeveldbFailStore extends AbstractFailStore { @Override public void put(String key, Object value) throws FailStoreException { try { String valueString = JSON.toJSONString(value); assert valueString != null; db.put(key.getBytes("UTF-8"), valueString.getBytes("UTF-8")); } catch (Exception e) { throw new FailStoreException(e); } } }
LeveldbFailStore extends AbstractFailStore { @Override public void put(String key, Object value) throws FailStoreException { try { String valueString = JSON.toJSONString(value); assert valueString != null; db.put(key.getBytes("UTF-8"), valueString.getBytes("UTF-8")); } catch (Exception e) { throw new FailStoreException(e); } } LeveldbFailStore(File dbPath, boolean needLock); }
LeveldbFailStore extends AbstractFailStore { @Override public void put(String key, Object value) throws FailStoreException { try { String valueString = JSON.toJSONString(value); assert valueString != null; db.put(key.getBytes("UTF-8"), valueString.getBytes("UTF-8")); } catch (Exception e) { throw new FailStoreException(e); } } LeveldbFailStore(File dbPath, boolean needLock); @Override void open(); @Override void put(String key, Object value); @Override void delete(String key); @Override void delete(List<String> keys); @Override List<Pair<String, T>> fetchTop(int size, Type type); @Override void close(); void destroy(); }
LeveldbFailStore extends AbstractFailStore { @Override public void put(String key, Object value) throws FailStoreException { try { String valueString = JSON.toJSONString(value); assert valueString != null; db.put(key.getBytes("UTF-8"), valueString.getBytes("UTF-8")); } catch (Exception e) { throw new FailStoreException(e); } } LeveldbFailStore(File dbPath, boolean needLock); @Override void open(); @Override void put(String key, Object value); @Override void delete(String key); @Override void delete(List<String> keys); @Override List<Pair<String, T>> fetchTop(int size, Type type); @Override void close(); void destroy(); static final String name; }