remove warning

This commit is contained in:
Shinsuke Sugaya 2019-07-30 06:49:33 +09:00
parent e3096bf41f
commit 967f151fe3
4 changed files with 13 additions and 10 deletions

View file

@ -166,7 +166,7 @@ public class SearchLogService {
cb.fetchFirst(0);
createSearchLogCondition(pager, cb);
cb.aggregation().setRequestedAt_DateHistogram(SearchLogPager.LOG_TYPE_SEARCH_COUNT_HOUR, op -> {
op.dateHistogramInterval(DateHistogramInterval.HOUR);
op.calendarInterval(DateHistogramInterval.HOUR);
op.minDocCount(0);
op.order(BucketOrder.key(true));
}, null);
@ -186,7 +186,7 @@ public class SearchLogService {
cb.fetchFirst(0);
createSearchLogCondition(pager, cb);
cb.aggregation().setRequestedAt_DateHistogram(SearchLogPager.LOG_TYPE_SEARCH_COUNT_DAY, op -> {
op.dateHistogramInterval(DateHistogramInterval.DAY);
op.calendarInterval(DateHistogramInterval.DAY);
op.minDocCount(0);
op.order(BucketOrder.key(true));
}, null);
@ -206,7 +206,7 @@ public class SearchLogService {
cb.fetchFirst(0);
createSearchLogCondition(pager, cb);
cb.aggregation().setRequestedAt_DateHistogram(SearchLogPager.LOG_TYPE_SEARCH_USER_HOUR, op -> {
op.dateHistogramInterval(DateHistogramInterval.HOUR);
op.calendarInterval(DateHistogramInterval.HOUR);
op.subAggregation(AggregationBuilders.cardinality(USER_INFO_ID).field(USER_INFO_ID));
op.minDocCount(0);
op.order(BucketOrder.key(true));
@ -228,7 +228,7 @@ public class SearchLogService {
cb.fetchFirst(0);
createSearchLogCondition(pager, cb);
cb.aggregation().setRequestedAt_DateHistogram(SearchLogPager.LOG_TYPE_SEARCH_USER_DAY, op -> {
op.dateHistogramInterval(DateHistogramInterval.DAY);
op.calendarInterval(DateHistogramInterval.DAY);
op.subAggregation(AggregationBuilders.cardinality(USER_INFO_ID).field(USER_INFO_ID));
op.minDocCount(0);
op.order(BucketOrder.key(true));
@ -250,7 +250,7 @@ public class SearchLogService {
cb.fetchFirst(0);
createSearchLogCondition(pager, cb);
cb.aggregation().setRequestedAt_DateHistogram(SearchLogPager.LOG_TYPE_SEARCH_REQTIMEAVG_HOUR, op -> {
op.dateHistogramInterval(DateHistogramInterval.HOUR);
op.calendarInterval(DateHistogramInterval.HOUR);
op.subAggregation(AggregationBuilders.avg(QUERY_TIME).field(QUERY_TIME));
op.minDocCount(0);
op.order(BucketOrder.key(true));
@ -272,7 +272,7 @@ public class SearchLogService {
cb.fetchFirst(0);
createSearchLogCondition(pager, cb);
cb.aggregation().setRequestedAt_DateHistogram(SearchLogPager.LOG_TYPE_SEARCH_REQTIMEAVG_DAY, op -> {
op.dateHistogramInterval(DateHistogramInterval.DAY);
op.calendarInterval(DateHistogramInterval.DAY);
op.subAggregation(AggregationBuilders.avg(QUERY_TIME).field(QUERY_TIME));
op.minDocCount(0);
op.order(BucketOrder.key(true));

View file

@ -993,7 +993,6 @@ public class FessEsClient implements Client {
final BulkResponse response = bulkRequestBuilder.execute().actionGet(ComponentUtil.getFessConfig().getIndexBulkTimeout());
if (response.hasFailures()) {
if (logger.isDebugEnabled()) {
@SuppressWarnings("rawtypes")
final List<DocWriteRequest<?>> requests = bulkRequestBuilder.request().requests();
final BulkItemResponse[] items = response.getItems();
if (requests.size() == items.length) {

View file

@ -1900,6 +1900,7 @@ public interface FessProp {
String getApiGsaResponseHeaders();
default List<Pair<String, String>> getApiGsaResponseHeaderList() {
@SuppressWarnings("unchecked")
List<Pair<String, String>> list = (List<Pair<String, String>>) propMap.get(API_GSA_RESPONSE_HEADER_LIST);
if (list == null) {
list = split(getApiGsaResponseHeaders(), "\n").get(stream -> stream.filter(StringUtil::isNotBlank).map(s -> {
@ -1917,6 +1918,7 @@ public interface FessProp {
String getApiJsonResponseHeaders();
default List<Pair<String, String>> getApiJsonResponseHeaderList() {
@SuppressWarnings("unchecked")
List<Pair<String, String>> list = (List<Pair<String, String>>) propMap.get(API_JSON_RESPONSE_HEADER_LIST);
if (list == null) {
list = split(getApiJsonResponseHeaders(), "\n").get(stream -> stream.filter(StringUtil::isNotBlank).map(s -> {
@ -1934,6 +1936,7 @@ public interface FessProp {
String getApiDashboardResponseHeaders();
default List<Pair<String, String>> getApiDashboardResponseHeaderList() {
@SuppressWarnings("unchecked")
List<Pair<String, String>> list = (List<Pair<String, String>>) propMap.get(API_DASHBOARD_RESPONSE_HEADER_LIST);
if (list == null) {
list = split(getApiDashboardResponseHeaders(), "\n").get(stream -> stream.filter(StringUtil::isNotBlank).map(s -> {
@ -1951,6 +1954,7 @@ public interface FessProp {
String getApiCorsAllowOrigin();
default List<String> getApiCorsAllowOriginList() {
@SuppressWarnings("unchecked")
List<String> list = (List<String>) propMap.get(CORS_ALLOW_ORIGIN);
if (list == null) {
list =

View file

@ -161,13 +161,13 @@ public final class UpgradeUtil {
return false;
}
public static boolean addData(final Client fessEsClient, final String index, final String type, final String id, final String source) {
public static boolean addData(final Client fessEsClient, final String index, final String id, final String source) {
try {
final IndexRequest indexRequest = new IndexRequest(index, type, id).source(source, XContentType.JSON);
final IndexRequest indexRequest = new IndexRequest(index).id(id).source(source, XContentType.JSON);
fessEsClient.index(indexRequest).actionGet();
return true;
} catch (final Exception e) {
logger.warn("Failed to add " + id + " to " + index + "/" + type, e);
logger.warn("Failed to add " + id + " to " + index, e);
}
return false;
}