@SuppressWarnings({ "unchecked", "rawtypes" }) public static Builder fromString(String s) { // Cast from HashMap<String, String> to HashMap<String, Object> is safe return new Builder((HashMap) DataUtils.parseMap(s)); }
/** * Build a block from the given string. * * @param s the string * @return the block */ public static Chunk fromString(String s) { HashMap<String, String> map = DataUtils.parseMap(s); int id = DataUtils.readHexInt(map, "chunk", 0); Chunk c = new Chunk(id); c.block = DataUtils.readHexLong(map, "block", 0); c.len = DataUtils.readHexInt(map, "len", 0); c.pageCount = DataUtils.readHexInt(map, "pages", 0); c.pageCountLive = DataUtils.readHexInt(map, "livePages", c.pageCount); c.mapId = DataUtils.readHexInt(map, "map", 0); c.maxLen = DataUtils.readHexLong(map, "max", 0); c.maxLenLive = DataUtils.readHexLong(map, "liveMax", c.maxLen); c.metaRootPos = DataUtils.readHexLong(map, "root", 0); c.time = DataUtils.readHexLong(map, "time", 0); c.unused = DataUtils.readHexLong(map, "unused", 0); c.version = DataUtils.readHexLong(map, "version", id); c.next = DataUtils.readHexLong(map, "next", 0); return c; }
/** * Read the configuration from a string. * * @param s the string representation * @return the builder */ public static Builder fromString(String s) { HashMap<String, String> config = DataUtils.parseMap(s); Builder builder = new Builder(); builder.config.putAll(config); return builder; }
@SuppressWarnings({ "unchecked", "rawtypes" }) public static Builder fromString(String s) { // Cast from HashMap<String, String> to HashMap<String, Object> is safe return new Builder((HashMap) DataUtils.parseMap(s)); }
/** * Read the configuration from a string. * * @param s the string representation * @return the builder */ public static Builder fromString(String s) { HashMap<String, String> config = DataUtils.parseMap(s); Builder builder = new Builder(); builder.config.putAll(config); return builder; }
/** * Get the name of the given map. * * @param id the map id * @return the name, or null if not found */ public synchronized String getMapName(int id) { checkOpen(); String m = meta.get(MVMap.getMapKey(id)); return m == null ? null : DataUtils.parseMap(m).get("name"); }
/** * Get the name of the given map. * * @param id the map id * @return the name, or null if not found */ public synchronized String getMapName(int id) { checkOpen(); String m = meta.get(MVMap.getMapKey(id)); return m == null ? null : DataUtils.parseMap(m).get("name"); }
lastBlock.get(buff); String s = new String(buff, DataUtils.LATIN).trim(); HashMap<String, String> m = DataUtils.parseMap(s); int check = DataUtils.readHexInt(m, "fletcher", 0); m.remove("fletcher");
lastBlock.get(buff); String s = new String(buff, DataUtils.LATIN).trim(); HashMap<String, String> m = DataUtils.parseMap(s); int check = DataUtils.readHexInt(m, "fletcher", 0); m.remove("fletcher");
String config = meta.get(MVMap.getMapKey(id)); c = New.hashMap(); c.putAll(DataUtils.parseMap(config)); c.put("id", id); map.init(this, c);
String config = meta.get(MVMap.getMapKey(id)); c = New.hashMap(); c.putAll(DataUtils.parseMap(config)); c.put("id", id); map.init(this, c);
String s = new String(buff, 0, BLOCK_SIZE, DataUtils.LATIN).trim(); HashMap<String, String> m = DataUtils.parseMap(s); int blockSize = DataUtils.readHexInt( m, "blockSize", BLOCK_SIZE);
String s = new String(buff, 0, BLOCK_SIZE, DataUtils.LATIN).trim(); HashMap<String, String> m = DataUtils.parseMap(s); int blockSize = DataUtils.readHexInt( m, "blockSize", BLOCK_SIZE);
/** * Build a block from the given string. * * @param s the string * @return the block */ public static Chunk fromString(String s) { HashMap<String, String> map = DataUtils.parseMap(s); int id = DataUtils.readHexInt(map, "chunk", 0); Chunk c = new Chunk(id); c.block = DataUtils.readHexLong(map, "block", 0); c.len = DataUtils.readHexInt(map, "len", 0); c.pageCount = DataUtils.readHexInt(map, "pages", 0); c.pageCountLive = DataUtils.readHexInt(map, "livePages", c.pageCount); c.mapId = DataUtils.readHexInt(map, "map", 0); c.maxLen = DataUtils.readHexLong(map, "max", 0); c.maxLenLive = DataUtils.readHexLong(map, "liveMax", c.maxLen); c.metaRootPos = DataUtils.readHexLong(map, "root", 0); c.time = DataUtils.readHexLong(map, "time", 0); c.unused = DataUtils.readHexLong(map, "unused", 0); c.version = DataUtils.readHexLong(map, "version", id); c.next = DataUtils.readHexLong(map, "next", 0); return c; }
/** * Build a block from the given string. * * @param s the string * @return the block */ public static Chunk fromString(String s) { HashMap<String, String> map = DataUtils.parseMap(s); int id = DataUtils.readHexInt(map, "chunk", 0); Chunk c = new Chunk(id); c.block = DataUtils.readHexLong(map, "block", 0); c.len = DataUtils.readHexInt(map, "len", 0); c.pageCount = DataUtils.readHexInt(map, "pages", 0); c.pageCountLive = DataUtils.readHexInt(map, "livePages", c.pageCount); c.mapId = DataUtils.readHexInt(map, "map", 0); c.maxLen = DataUtils.readHexLong(map, "max", 0); c.maxLenLive = DataUtils.readHexLong(map, "liveMax", c.maxLen); c.metaRootPos = DataUtils.readHexLong(map, "root", 0); c.time = DataUtils.readHexLong(map, "time", 0); c.unused = DataUtils.readHexLong(map, "unused", 0); c.version = DataUtils.readHexLong(map, "version", id); c.next = DataUtils.readHexLong(map, "next", 0); return c; }
/** * Build a block from the given string. * * @param s the string * @return the block */ public static Chunk fromString(String s) { HashMap<String, String> map = DataUtils.parseMap(s); int id = DataUtils.readHexInt(map, "chunk", 0); Chunk c = new Chunk(id); c.block = DataUtils.readHexLong(map, "block", 0); c.len = DataUtils.readHexInt(map, "len", 0); c.pageCount = DataUtils.readHexInt(map, "pages", 0); c.pageCountLive = DataUtils.readHexInt(map, "livePages", c.pageCount); c.mapId = DataUtils.readHexInt(map, "map", 0); c.maxLen = DataUtils.readHexLong(map, "max", 0); c.maxLenLive = DataUtils.readHexLong(map, "liveMax", c.maxLen); c.metaRootPos = DataUtils.readHexLong(map, "root", 0); c.time = DataUtils.readHexLong(map, "time", 0); c.unused = DataUtils.readHexLong(map, "unused", 0); c.version = DataUtils.readHexLong(map, "version", id); c.next = DataUtils.readHexLong(map, "next", 0); return c; }