/** * A convenience method for setting the long encoding type. * * @param is * IteratorSetting object to configure. * @param encoderClassName * name of a class specifying the encoding type. */ public static void setEncodingType(IteratorSetting is, String encoderClassName) { is.addOption(TYPE, CLASS_PREFIX + encoderClassName); } }
/** * A convenience method for setting the index column family. * * @param is * IteratorSetting object to configure. * @param indexColf * the index column family */ public static void setIndexColf(IteratorSetting is, String indexColf) { is.addOption(indexFamilyOptionName, indexColf); }
/** * A convenience method for setting the encoding type. * * @param is * IteratorSetting object to configure. * @param encoderClassName * name of a class specifying the encoding type. */ public static void setEncodingType(IteratorSetting is, String encoderClassName) { is.addOption(TYPE, CLASS_PREFIX + encoderClassName); } }
/** * Configure the maximum amount of memory that can be used for transformation. If this memory is * exceeded an exception will be thrown. * * @param maxBufferSize * size in bytes */ public static void setMaxBufferSize(IteratorSetting config, long maxBufferSize) { config.addOption(MAX_BUFFER_SIZE_OPT, maxBufferSize + ""); }
/** * Encode the grep term as an option for a ScanIterator */ public static void setTerm(IteratorSetting cfg, String term) { cfg.addOption("term", term); } }
/** * A convenience method for setting the document column family prefix. * * @param is * IteratorSetting object to configure. * @param docColfPrefix * the prefix of the document column family (colf will be of the form * docColfPrefix\0doctype) */ public static void setDocColfPrefix(IteratorSetting is, String docColfPrefix) { is.addOption(docFamilyOptionName, docColfPrefix); }
/** * A convenience method to set the "all columns" option on a Combiner. This will combine all * columns individually within each row. * * @param is * iterator settings object to configure * @param combineAllColumns * if true, the columns option is ignored and the Combiner will be applied to all columns */ public static void setCombineAllColumns(IteratorSetting is, boolean combineAllColumns) { is.addOption(ALL_OPTION, Boolean.toString(combineAllColumns)); }
/** * A convenience method for setting the age off threshold. * * @param is * IteratorSetting object to configure. * @param ttl * age off threshold in milliseconds. */ public static void setTTL(IteratorSetting is, Long ttl) { is.addOption(TTL, Long.toString(ttl)); }
/** * A convenience method for setting the long encoding type. * * @param is * IteratorSetting object to configure. * @param encoderClass * {@code Class<? extends Encoder<Long>>} specifying the encoding type. */ public static void setEncodingType(IteratorSetting is, Class<? extends Encoder<Long>> encoderClass) { is.addOption(TYPE, CLASS_PREFIX + encoderClass.getName()); }
/** * A convenience method for setting the encoding type. * * @param is * IteratorSetting object to configure. * @param encoderClass * {@code Class<? extends Encoder<List<Long>>>} specifying the encoding type. */ public static void setEncodingType(IteratorSetting is, Class<? extends Encoder<List<Long>>> encoderClass) { is.addOption(TYPE, CLASS_PREFIX + encoderClass.getName()); }
/** * A convenience method for setting the maximum number of columns to keep. * * @param is * IteratorSetting object to configure. * @param maxColumns * number of columns to keep. */ public static void setMaxColumns(IteratorSetting is, int maxColumns) { is.addOption(MAX_COLUMNS, Integer.toString(maxColumns)); } }
/** * convenience method to set the option to optimize the frequency of scans vs. seeks */ public static void setNumScansBeforeSeek(IteratorSetting cfg, int num) { cfg.addOption(NUM_SCANS_STRING_NAME, Integer.toString(num)); }
/** * Encode the maximum number of versions to return onto the ScanIterator */ public static void setMaxVersions(IteratorSetting cfg, int maxVersions) { if (maxVersions < 1) throw new IllegalArgumentException(MAXVERSIONS_OPT + " for versioning iterator must be >= 1"); cfg.addOption(MAXVERSIONS_OPT, Integer.toString(maxVersions)); } }
/** * Add many options to the iterator. * * @param propertyEntries * a set of entries to add to the options */ public void addOptions(Set<Entry<String,String>> propertyEntries) { checkArgument(propertyEntries != null, "propertyEntries is null"); for (Entry<String,String> keyValue : propertyEntries) { addOption(keyValue.getKey(), keyValue.getValue()); } }
/** * Configure authorizations used for post transformation filtering. * */ public static void setAuthorizations(IteratorSetting config, Authorizations auths) { config.addOption(AUTH_OPT, auths.serialize()); }
/** * A convenience method for setting the encoding type. * * @param is * IteratorSetting object to configure. * @param type * SummingArrayCombiner.Type specifying the encoding type. */ public static void setEncodingType(IteratorSetting is, Type type) { is.addOption(TYPE, type.toString()); }
/** * A convenience method for setting the long encoding type. * * @param is * IteratorSetting object to configure. * @param type * LongCombiner.Type specifying the encoding type. */ public static void setEncodingType(IteratorSetting is, LongCombiner.Type type) { is.addOption(TYPE, type.toString()); }
/** * Encode the columns to be used when iterating. */ public static void setColumnFamilies(IteratorSetting cfg, Text[] columns) { if (columns.length < 1) throw new IllegalArgumentException("Must supply at least one term to intersect"); cfg.addOption(IntersectingIterator.columnFamiliesOptionName, IntersectingIterator.encodeColumns(columns)); }
public static void setCurrentServers(IteratorSetting cfg, Set<TServerInstance> goodServers) { if (goodServers != null) { List<String> servers = new ArrayList<>(); for (TServerInstance server : goodServers) servers.add(server.toString()); cfg.addOption(SERVERS_OPTION, Joiner.on(",").join(servers)); } }
public static void setShuttingDown(IteratorSetting cfg, Set<TServerInstance> servers) { if (servers != null) { List<String> serverList = new ArrayList<>(); for (TServerInstance server : servers) { serverList.add(server.toString()); } cfg.addOption(SHUTTING_DOWN_OPTION, Joiner.on(",").join(servers)); } }