コード例 #1
0
	/**
	 * Indices deleted.
	 *
	 * @return the list
	 */
	public List<String> indicesDeleted() {
		if (previousState == null) {
			return ImmutableList.of();
		}
		if (!metaDataChanged()) {
			return ImmutableList.of();
		}
		List<String> deleted = null;
		for (String index : previousState.metaData().indices().keySet()) {
			if (!state.metaData().hasIndex(index)) {
				if (deleted == null) {
					deleted = Lists.newArrayList();
				}
				deleted.add(index);
			}
		}
		return deleted == null ? ImmutableList.<String> of() : deleted;
	}
コード例 #2
0
	/**
	 * Indices created.
	 *
	 * @return the list
	 */
	public List<String> indicesCreated() {
		if (previousState == null) {
			return Lists.newArrayList(state.metaData().indices().keySet());
		}
		if (!metaDataChanged()) {
			return ImmutableList.of();
		}
		List<String> created = null;
		for (String index : state.metaData().indices().keySet()) {
			if (!previousState.metaData().hasIndex(index)) {
				if (created == null) {
					created = Lists.newArrayList();
				}
				created.add(index);
			}
		}
		return created == null ? ImmutableList.<String> of() : created;
	}
コード例 #3
0
	/**
	 * Index meta data changed.
	 *
	 * @param current the current
	 * @return true, if successful
	 */
	public boolean indexMetaDataChanged(IndexMetaData current) {
		MetaData previousMetaData = previousState.metaData();
		if (previousMetaData == null) {
			return true;
		}
		IndexMetaData previousIndexMetaData = previousMetaData.index(current.index());

		if (previousIndexMetaData == current) {
			return false;
		}
		return true;
	}
コード例 #4
0
	/**
	 * Meta data changed.
	 *
	 * @return true, if successful
	 */
	public boolean metaDataChanged() {
		return state.metaData() != previousState.metaData();
	}