/** {@inheritDoc} */ @Override public void setTableAnnotations( final Map<String, String> kvs ) throws IOException { requireState(State.OPEN, "set annotation"); for (Map.Entry<String, String> kv: kvs.entrySet()) { validateAnnotationKey(kv.getKey()); setKV(getMetaTableKey(kv.getKey()), kv.getValue()); } }
/** {@inheritDoc} */ @Override public void setColumnAnnotations( final FijiColumnName column, final Map<String, String> kvs ) throws IOException { requireState(State.OPEN, "set annotation"); for (Map.Entry<String, String> kv: kvs.entrySet()) { validateAnnotationKey(kv.getKey()); setKV(getMetaTableKey(mTable, column, kv.getKey()), kv.getValue()); } }
/** {@inheritDoc} */ @Override public String getColumnAnnotation( final FijiColumnName column, final String exactKey ) throws IOException { requireState(State.OPEN, "get annotation"); return getKV(getMetaTableKey(mTable, column, exactKey)); }
/** {@inheritDoc} */ @Override public void removeTableAnnotation( final String exactKey ) throws IOException { requireState(State.OPEN, "remove annotation"); removeKV(getMetaTableKey(exactKey)); }
/** {@inheritDoc} */ @Override public void removeColumnAnnotation( final FijiColumnName column, final String exactKey ) throws IOException { requireState(State.OPEN, "remove annotation"); removeKV(getMetaTableKey(mTable, column, exactKey)); }
/** {@inheritDoc} */ @Override public String getTableAnnotation( final String exactKey ) throws IOException { requireState(State.OPEN, "get annotation"); return getKV(getMetaTableKey(exactKey)); }
/** {@inheritDoc} */ @Override public Map<String, String> getAllTableAnnotations() throws IOException { requireState(State.OPEN, "get annotation"); final Map<String, String> collectedAnnotations = Maps.newHashMap(); for (String metaTableKey : keySet()) { if (isKCATableMetaTableKey(metaTableKey)) { collectedAnnotations.put(keyFromMetaTableKey(metaTableKey), getKV(metaTableKey)); } } return collectedAnnotations; }
/** {@inheritDoc} */ @Override public Set<String> removeAllTableAnnotations() throws IOException { requireState(State.OPEN, "remove annotation"); final Set<String> removedAnnotationKeys = Sets.newHashSet(); for (String metaTableKey : keySet()) { if (isKCATableMetaTableKey(metaTableKey)) { removedAnnotationKeys.add(keyFromMetaTableKey(metaTableKey)); removeKV(metaTableKey); } } return removedAnnotationKeys; }
/** {@inheritDoc} */ @Override public Set<String> removeTableAnnotationsContaining( final String substring ) throws IOException { requireState(State.OPEN, "remove annotation"); final Set<String> removedAnnotationKeys = Sets.newHashSet(); for (String metaTableKey : keySet()) { if (isKCATableMetaTableKey(metaTableKey)) { final String annotationKey = keyFromMetaTableKey(metaTableKey); if (annotationKey.contains(substring)) { removedAnnotationKeys.add(annotationKey); removeKV(metaTableKey); } } } return removedAnnotationKeys; }
/** {@inheritDoc} */ @Override public Set<String> removeAllColumnAnnotations( final FijiColumnName column ) throws IOException { requireState(State.OPEN, "remove annotation"); final Set<String> removedAnnotationKeys = Sets.newHashSet(); for (String metaTableKey : keySet()) { if (isKCAColumnMetaTableKey(metaTableKey) && Objects.equal(column, columnFromMetaTableKey(metaTableKey))) { removedAnnotationKeys.add(keyFromMetaTableKey(metaTableKey)); removeKV(metaTableKey); } } return removedAnnotationKeys; }
/** {@inheritDoc} */ @Override public void setColumnAnnotation( final FijiColumnName column, final String key, final String value ) throws IOException { requireState(State.OPEN, "set annotation"); validateAnnotationKey(key); setKV(getMetaTableKey(mTable, column, key), value); }
/** {@inheritDoc} */ @Override public Map<String, String> getAllColumnAnnotations( final FijiColumnName column ) throws IOException { requireState(State.OPEN, "get annotation"); final Map<String, String> collectedAnnotations = Maps.newHashMap(); for (String metaTableKey : keySet()) { if (isKCAColumnMetaTableKey(metaTableKey) && Objects.equal(column, columnFromMetaTableKey(metaTableKey))) { collectedAnnotations.put(keyFromMetaTableKey(metaTableKey), getKV(metaTableKey)); } } return collectedAnnotations; }
/** {@inheritDoc} */ @Override public Map<String, String> getColumnAnnotationsContaining( final FijiColumnName column, final String substring ) throws IOException { requireState(State.OPEN, "get annotation"); final Map<String, String> collectedAnnotations = Maps.newHashMap(); for (String metaTableKey : keySet()) { if (isKCAColumnMetaTableKey(metaTableKey) && Objects.equal(column, columnFromMetaTableKey(metaTableKey))) { final String annotationKey = keyFromMetaTableKey(metaTableKey); if (annotationKey.contains(substring)) { collectedAnnotations.put(annotationKey, getKV(metaTableKey)); } } } return collectedAnnotations; }
/** {@inheritDoc} */ @Override public Map<String, String> getColumnAnnotationsMatching( final FijiColumnName column, final String pattern ) throws IOException { requireState(State.OPEN, "get annotation"); final Map<String, String> collectedAnnotations = Maps.newHashMap(); for (String metaTableKey : keySet()) { if (isKCAColumnMetaTableKey(metaTableKey) && Objects.equal(column, columnFromMetaTableKey(metaTableKey))) { final String annotationKey = keyFromMetaTableKey(metaTableKey); if (annotationKey.matches(pattern)) { collectedAnnotations.put(annotationKey, getKV(metaTableKey)); } } } return collectedAnnotations; }
/** {@inheritDoc} */ @Override public Map<String, String> getTableAnnotationsMatching( final String pattern ) throws IOException { requireState(State.OPEN, "get annotation"); final Map<String, String> collectedAnnotations = Maps.newHashMap(); for (String metaTableKey : keySet()) { if (isKCATableMetaTableKey(metaTableKey)) { final String annotationKey = keyFromMetaTableKey(metaTableKey); if (keyFromMetaTableKey(metaTableKey).matches(pattern)) { collectedAnnotations.put(annotationKey, getKV(metaTableKey)); } } } return collectedAnnotations; }
/** {@inheritDoc} */ @Override public Map<String, String> getColumnAnnotationsStartingWith( final FijiColumnName column, final String prefix ) throws IOException { requireState(State.OPEN, "get annotation"); final Map<String, String> collectedAnnotations = Maps.newHashMap(); for (String metaTableKey : keySet()) { if (isKCAColumnMetaTableKey(metaTableKey) && Objects.equal(column, columnFromMetaTableKey(metaTableKey))) { final String annotationKey = keyFromMetaTableKey(metaTableKey); if (annotationKey.startsWith(prefix)) { collectedAnnotations.put(annotationKey, getKV(metaTableKey)); } } } return collectedAnnotations; }
/** {@inheritDoc} */ @Override public void setTableAnnotation( final String key, final String value ) throws IOException { requireState(State.OPEN, "set annotation"); validateAnnotationKey(key); setKV(getMetaTableKey(key), value); }
/** {@inheritDoc} */ @Override public Map<String, String> getTableAnnotationsStartingWith( final String prefix ) throws IOException { requireState(State.OPEN, "get annotation"); final Map<String, String> collectedAnnotations = Maps.newHashMap(); for (String metaTableKey : keySet()) { if (isKCATableMetaTableKey(metaTableKey)) { final String annotationKey = keyFromMetaTableKey(metaTableKey); if (keyFromMetaTableKey(metaTableKey).startsWith(prefix)) { collectedAnnotations.put(annotationKey, getKV(metaTableKey)); } } } return collectedAnnotations; }
/** {@inheritDoc} */ @Override public Map<String, String> getTableAnnotationsContaining( final String substring ) throws IOException { requireState(State.OPEN, "get annotation"); final Map<String, String> collectedAnnotations = Maps.newHashMap(); for (String metaTableKey : keySet()) { if (isKCATableMetaTableKey(metaTableKey)) { final String annotationKey = keyFromMetaTableKey(metaTableKey); if (keyFromMetaTableKey(metaTableKey).contains(substring)) { collectedAnnotations.put(annotationKey, getKV(metaTableKey)); } } } return collectedAnnotations; }
/** {@inheritDoc} */ @Override public Map<FijiColumnName, String> getColumnAnnotationsInFamily( final String family, final String exactKey ) throws IOException { requireState(State.OPEN, "get annotation"); final Map<FijiColumnName, String> collectedAnnotations = Maps.newHashMap(); for (String metaTableKey : keySet()) { if (isKCAColumnMetaTableKey(metaTableKey)) { final FijiColumnName column = columnFromMetaTableKey(metaTableKey); if (null != column && Objects.equal(family, column.getFamily()) && Objects.equal(exactKey, keyFromMetaTableKey(metaTableKey))) { collectedAnnotations.put(column, getKV(metaTableKey)); } } } return collectedAnnotations; }