public List<FilterInfo> getFiltersForIndex(String index) { List<String> filterInfoList = getFilterIdsIndex(index); if (filterInfoList.isEmpty()) { return Collections.emptyList(); } Rows<String, String> result = cassandraGateway.getByFilterIds(filterInfoList); if (result == null || result.isEmpty()) { return Collections.emptyList(); } else { List<FilterInfo> filterInfos = new ArrayList<FilterInfo>(); Iterator<Row<String, String>> rows = result.iterator(); while (rows.hasNext()) { Row<String, String> row = rows.next(); FilterInfo script = getFilterScriptFromCassandraRow(row); if (script != null) { filterInfos.add(script); } } Collections.sort(filterInfos); return filterInfos; } }
public List<FilterInfo> getFiltersForIndex(String index) { List<String> filterInfoList = getFilterIdsIndex(index); if (filterInfoList.isEmpty()) { return Collections.emptyList(); } Rows<String, String> result = cassandraGateway.getByFilterIds(filterInfoList); if (result == null || result.isEmpty()) { return Collections.emptyList(); } else { List<FilterInfo> filterInfos = new ArrayList<FilterInfo>(); Iterator<Row<String, String>> rows = result.iterator(); while (rows.hasNext()) { Row<String, String> row = rows.next(); FilterInfo script = getFilterScriptFromCassandraRow(row); if (script != null) { filterInfos.add(script); } } Collections.sort(filterInfos); return filterInfos; } }