/** * Lookup a schema. * * @return Tool exit code. * @throws IOException in case of an error. */ private int lookupSchema() throws IOException { final FijiSchemaTable table = mFiji.getSchemaTable(); final File file = new File(mLookupFlag); final Schema schema = new Schema.Parser().parse(file); final SchemaEntry sEntry = table.getSchemaEntry(schema); final long id = sEntry.getId(); final BytesKey hash = sEntry.getHash(); if (isInteractive()) { getPrintStream().print("Schema ID for the given schema is: "); } getPrintStream().println(id); if (isInteractive()) { getPrintStream().print("Schema hash for the given schema is: "); } getPrintStream().println(hash); return SUCCESS; }
final FijiSchemaTable table = mFiji.getSchemaTable(); final BytesKey bytesKey = new BytesKey(ByteArrayFormatter.parseHex(mGetByHashFlag, ':')); final SchemaEntry sEntry = table.getSchemaEntry(bytesKey); final Schema schema = sEntry.getSchema();