/** * @return The {@link org.schemarepo.SubjectConfig} for this Subject */ @Override public SubjectConfig getConfig() { try { // TODO: Allow this behavior to be disabled once we have async updating // of the cache via ZK Observers... This would protect ZK from getting // hammered too much at the expense of slightly stale data. Properties props = new Properties(); byte[] rawProperties = zkClient.getData().forPath(getConfigFilePath()); props.load(new ByteArrayInputStream(rawProperties)); return RepositoryUtil.configFromProperties(props); } catch (Exception e) { throw new RuntimeException("An exception occurred while accessing ZK!", e); } }
@Override public SubjectConfig getConfig() { String path = getName() + "/config" ; try { String propString = webResource.path(path).get(String.class); Properties props = new Properties(); props.load(new StringReader(propString)); return RepositoryUtil.configFromProperties(props); } catch (Exception e) { return null; } }
@Override public SubjectConfig getConfig() { String path = getName() + "/config" ; try { String propString = webResource.path(path).get(String.class); Properties props = new Properties(); props.load(new StringReader(propString)); return RepositoryUtil.configFromProperties(props); } catch (Exception e) { return null; } }
@Override public SubjectConfig getConfig() { String path = getName() + "/config" ; SubjectConfig config = null; try { String propString = webResource.path(path).get(String.class); Properties props = new Properties(); props.load(new StringReader(propString)); config = RepositoryUtil.configFromProperties(props); } catch (RuntimeException e) { handleException(e, format("Failed to get config of subject %s", getName()), false); } catch (IOException e) { handleException(e, format("Failed to parse config data of subject %s", getName()), false); } return config; }
@Override public SubjectConfig getConfig() { String path = getName() + "/config" ; SubjectConfig config = null; try { String propString = webResource.path(path).get(String.class); Properties props = new Properties(); props.load(new StringReader(propString)); config = RepositoryUtil.configFromProperties(props); } catch (RuntimeException e) { handleException(e, format("Failed to get config of subject %s", getName()), false); } catch (IOException e) { handleException(e, format("Failed to parse config data of subject %s", getName()), false); } return config; }
try { props.load(new FileInputStream(propertyFile)); config = RepositoryUtil.configFromProperties(props); Integer lastId = null; HashSet<String> schemaFileNames = getSchemaFiles();
try { props.load(new FileInputStream(propertyFile)); config = RepositoryUtil.configFromProperties(props); Integer lastId = null; HashSet<String> schemaFileNames = getSchemaFiles();