Skip to content

Commit 888e3f5

Browse files
committed
Polish for enabling Function Executions to return results from all servers.
Resolves spring-projectsgh-37.
1 parent b4016f0 commit 888e3f5

File tree

8 files changed

+23
-21
lines changed

8 files changed

+23
-21
lines changed

spring-data-geode/src/main/java/org/springframework/data/gemfire/function/ExecutionTimeoutFunctionException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2020-2021 the original author or authors.
2+
* Copyright 2021 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

spring-data-geode/src/main/java/org/springframework/data/gemfire/function/UncategorizedFunctionException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2020-2021 the original author or authors.
2+
* Copyright 2021 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

spring-data-geode/src/main/java/org/springframework/data/gemfire/function/execution/AbstractFunctionExecution.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
/*
2+
<<<<<<< HEAD
23
* Copyright 2020-2021 the original author or authors.
4+
=======
5+
* Copyright 2020 the original author or authors.
6+
>>>>>>> 9eae72c6a... DATAGEODE-295 - Polish.
37
*
48
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
59
* the License. You may obtain a copy of the License at
@@ -40,14 +44,11 @@
4044
* @author David Turanski
4145
* @author John Blum
4246
* @author Patrick Johnson
43-
<<<<<<< HEAD
4447
* @see java.util.concurrent.TimeUnit
4548
* @see org.apache.geode.cache.execute.Execution
4649
* @see org.apache.geode.cache.execute.Function
4750
* @see org.apache.geode.cache.execute.FunctionService
4851
* @see org.apache.geode.cache.execute.ResultCollector
49-
=======
50-
>>>>>>> ae69760bf... DATAGEODE-295 - Functions return results from all servers.
5152
*/
5253
@SuppressWarnings("unused")
5354
abstract class AbstractFunctionExecution {

spring-data-geode/src/main/java/org/springframework/data/gemfire/function/execution/GemfireFunctionProxyFactoryBean.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,9 @@ protected Class<?> getFunctionExecutionInterface() {
122122

123123
GemfireFunctionOperations template = getGemfireFunctionOperations();
124124

125-
String functionId = getFunctionExecutionMethodMetadata().getMethodMetadata(method).getFunctionId();
125+
String functionId = getFunctionExecutionMethodMetadata()
126+
.getMethodMetadata(method)
127+
.getFunctionId();
126128

127129
return isFunctionExecutionForAllServers(method)
128130
? template.execute(functionId, args)

spring-data-geode/src/main/java/org/springframework/data/gemfire/function/execution/OnRegionFunctionExecution.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@
1919
import org.apache.geode.cache.execute.Function;
2020
import org.apache.geode.cache.execute.FunctionService;
2121

22-
import org.apache.shiro.util.Assert;
23-
24-
import org.springframework.util.CollectionUtils;
22+
import org.springframework.data.gemfire.util.CollectionUtils;
23+
import org.springframework.util.Assert;
2524

2625
/**
2726
* Creates an {@literal OnRegion} {@link Function} {@link Execution} initialized with a {@link Region}

spring-data-geode/src/test/java/org/springframework/data/gemfire/function/execution/onservers/FunctionsReturnResultsFromAllServersIntegrationTests.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ static class MetricsFunctionServerProcess {
113113
private static final int DEFAULT_CACHE_SERVER_PORT = 40404;
114114

115115
private static final String CACHE_SERVER_PORT_PROPERTY = "spring.data.gemfire.cache.server.port";
116-
private static final String GEMFIRE_LOG_LEVEL = "error";
117116
private static final String GEMFIRE_NAME = "MetricsServer" + getCacheServerPort();
118117

119118
public static void main(String[] args) throws Exception {
@@ -124,7 +123,6 @@ private static Cache newGemFireCache() {
124123

125124
return new CacheFactory()
126125
.set("name", GEMFIRE_NAME)
127-
.set("log-level", GEMFIRE_LOG_LEVEL)
128126
.create();
129127
}
130128

spring-data-geode/src/test/java/org/springframework/data/gemfire/function/execution/onservers/Metric.java

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,24 @@
1818

1919
import java.io.Serializable;
2020

21+
import lombok.AllArgsConstructor;
22+
import lombok.Getter;
23+
import lombok.ToString;
24+
2125
/**
2226
* @author Patrick Johnson
2327
*/
28+
@Getter
29+
@ToString
30+
@AllArgsConstructor
2431
public class Metric implements Serializable {
2532

26-
private String name;
33+
private final String name;
2734

28-
private Number value;
35+
private final Number value;
2936

30-
private String category;
37+
private final String category;
3138

32-
private String type;
39+
private final String type;
3340

34-
public Metric(String name, Number value, String category, String type) {
35-
this.name = name;
36-
this.value = value;
37-
this.category = category;
38-
this.type = type;
39-
}
4041
}

spring-data-geode/src/test/java/org/springframework/data/gemfire/util/SpringUtilsUnitTests.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
*
6262
* @author John Blum
6363
* @see java.util.function.Function
64+
* @see java.util.function.Supplier
6465
* @see org.junit.Test
6566
* @see org.mockito.Mock
6667
* @see org.mockito.Mockito

0 commit comments

Comments
 (0)