@Override public Map<String, String> names() { final ImmutableMap.Builder<String, String> map = new ImmutableMap.Builder<String, String>(); Iterables.all( this.table.frame().through( new QueryValve().withAttributesToGet( DyLocks.ATTR_LABEL ) ).where(DyLocks.HASH, Conditions.equalTo(this.owner)), new Predicate<Item>() { @Override public boolean apply(final Item item) { try { map.put( item.get(DyLocks.RANGE).getS(), item.get(DyLocks.ATTR_LABEL).getS() ); } catch (final IOException ex) { throw new IllegalStateException(ex); } return true; } } ); return map.build(); }
/** * Recent artifacts.. * @return List of them */ public Iterable<Iterable<Directive>> recent() { return new Mapped<>( item -> { final String[] parts = item.get("artifact").getS().split(":"); return new Directives() .add("repo") .add("group").set(parts[0]).up() .add("artifact").set(parts[1]).up() .up(); }, this.table.frame() .where("good", "true") .through( new QueryValve() .withScanIndexForward(false) .withIndexName("recent") .withConsistentRead(false) // @checkstyle MagicNumber (1 line) .withLimit(25) .withAttributesToGet("artifact") ) ); }
.withAttributesToGet( "artifact", "score", "diff", "defects", "classes", "elements", "rank"