Polish for enabling Function Executions to return results from all servers.

Resolves gh-37.
This commit is contained in:
John Blum
2020-02-27 21:45:51 -08:00
committed by John Blum
parent bfe0a6c93d
commit d899d3fa0a
8 changed files with 23 additions and 21 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2020-2021 the original author or authors.
* Copyright 2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2020-2021 the original author or authors.
* Copyright 2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,5 +1,9 @@
/*
<<<<<<< HEAD
* Copyright 2020-2021 the original author or authors.
=======
* Copyright 2020 the original author or authors.
>>>>>>> 9eae72c6a... DATAGEODE-295 - Polish.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
@@ -40,14 +44,11 @@ import org.slf4j.LoggerFactory;
* @author David Turanski
* @author John Blum
* @author Patrick Johnson
<<<<<<< HEAD
* @see java.util.concurrent.TimeUnit
* @see org.apache.geode.cache.execute.Execution
* @see org.apache.geode.cache.execute.Function
* @see org.apache.geode.cache.execute.FunctionService
* @see org.apache.geode.cache.execute.ResultCollector
=======
>>>>>>> ae69760bf... DATAGEODE-295 - Functions return results from all servers.
*/
@SuppressWarnings("unused")
abstract class AbstractFunctionExecution {

View File

@@ -122,7 +122,9 @@ public class GemfireFunctionProxyFactoryBean extends AbstractFactoryBeanSupport<
GemfireFunctionOperations template = getGemfireFunctionOperations();
String functionId = getFunctionExecutionMethodMetadata().getMethodMetadata(method).getFunctionId();
String functionId = getFunctionExecutionMethodMetadata()
.getMethodMetadata(method)
.getFunctionId();
return isFunctionExecutionForAllServers(method)
? template.execute(functionId, args)

View File

@@ -19,9 +19,8 @@ import org.apache.geode.cache.execute.Execution;
import org.apache.geode.cache.execute.Function;
import org.apache.geode.cache.execute.FunctionService;
import org.apache.shiro.util.Assert;
import org.springframework.util.CollectionUtils;
import org.springframework.data.gemfire.util.CollectionUtils;
import org.springframework.util.Assert;
/**
* Creates an {@literal OnRegion} {@link Function} {@link Execution} initialized with a {@link Region}

View File

@@ -113,7 +113,6 @@ public class FunctionsReturnResultsFromAllServersIntegrationTests extends Client
private static final int DEFAULT_CACHE_SERVER_PORT = 40404;
private static final String CACHE_SERVER_PORT_PROPERTY = "spring.data.gemfire.cache.server.port";
private static final String GEMFIRE_LOG_LEVEL = "error";
private static final String GEMFIRE_NAME = "MetricsServer" + getCacheServerPort();
public static void main(String[] args) throws Exception {
@@ -124,7 +123,6 @@ public class FunctionsReturnResultsFromAllServersIntegrationTests extends Client
return new CacheFactory()
.set("name", GEMFIRE_NAME)
.set("log-level", GEMFIRE_LOG_LEVEL)
.create();
}

View File

@@ -18,23 +18,24 @@ package org.springframework.data.gemfire.function.execution.onservers;
import java.io.Serializable;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.ToString;
/**
* @author Patrick Johnson
*/
@Getter
@ToString
@AllArgsConstructor
public class Metric implements Serializable {
private String name;
private final String name;
private Number value;
private final Number value;
private String category;
private final String category;
private String type;
private final String type;
public Metric(String name, Number value, String category, String type) {
this.name = name;
this.value = value;
this.category = category;
this.type = type;
}
}

View File

@@ -61,6 +61,7 @@ import org.springframework.data.gemfire.util.SpringUtils.ValueReturningThrowable
*
* @author John Blum
* @see java.util.function.Function
* @see java.util.function.Supplier
* @see org.junit.Test
* @see org.mockito.Mock
* @see org.mockito.Mockito