Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-2552: Removed deprecated code #2563

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 0 additions & 4 deletions .github/workflows/continuous-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,6 @@ jobs:
values: :gaffer2,:core,:access,:cache,:common-util,:data,:exception,:graph,:operation,:serialisation,:store,:type
- name: Accumulo
values: :accumulo-store,:accumulo-rest
- name: Hbase
values: :hbase-store,:hbase-rest
- name: Parquet
values: :parquet-store,:parquet-rest
- name: Federated-And-Map
values: :integration-test,:federated-store,:map-store,:map-rest
- name: REST
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
import java.nio.charset.Charset;
import java.util.List;
import java.util.Map;
import java.util.Set;

import static java.util.Collections.emptyList;

Expand Down Expand Up @@ -147,11 +146,6 @@ public List<String> getWriteAccessRoles() {
return writeAccessRoles;
}

@Deprecated
public boolean hasWriteAccess(final String userId, final Set<String> opAuths, final String adminAuth) {
return hasWriteAccess(new User.Builder().userId(userId).opAuths(opAuths).build(), adminAuth);
}

@Override
public ResourceType getResourceType() {
return ResourceType.NamedView;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,18 +194,6 @@ public ElementAggregator getAggregator() {
return aggregator;
}

/**
* Sets the aggregator
*
* @param aggregator the aggregator to set.
* @deprecated a {@link ViewElementDefinition} should be constructed using the
* {@link uk.gov.gchq.gaffer.data.elementdefinition.view.ViewElementDefinition.Builder}.
*/
@Deprecated
public void setAggregator(final ElementAggregator aggregator) {
this.aggregator = aggregator;
}

@JsonIgnore
public ElementFilter getPostAggregationFilter() {
return postAggregationFilter;
Expand Down
4 changes: 3 additions & 1 deletion core/graph/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ Here is an example of a `GraphConfig`:

```java
new GraphConfig.Builder()
.graphId("exampleGraphId")
.config(new GraphConfig.Builder()
.graphId("exampleGraphId")
.build())
.description("Example Graph description")
.view(new View.Builder()
.globalElements(new GlobalViewElementDefinition.Builder()
Expand Down
139 changes: 0 additions & 139 deletions core/graph/src/main/java/uk/gov/gchq/gaffer/graph/Graph.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
package uk.gov.gchq.gaffer.graph;

import com.google.common.collect.Lists;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -526,17 +525,6 @@ public static class Builder {
private String parentStorePropertiesId;
private boolean addToLibrary = true;

/**
* @param graphId the graph id to set
* @return this Builder
* @deprecated use Builder.config instead.
*/
@Deprecated
public Builder graphId(final String graphId) {
configBuilder.graphId(graphId);
return this;
}

public Builder config(final Path path) {
configBuilder.json(path);
return this;
Expand Down Expand Up @@ -567,72 +555,6 @@ public Builder addToLibrary(final boolean addToLibrary) {
return this;
}

/**
* @param library the graph library to set
* @return this Builder
* @deprecated use Builder.config instead.
*/
@Deprecated
public Builder library(final GraphLibrary library) {
configBuilder.library(library);
return this;
}

/**
* @param view the graph view to set
* @return this Builder
* @deprecated use Builder.config instead.
*/
@Deprecated
public Builder view(final View view) {
configBuilder.view(view);
return this;
}

/**
* @param view the graph view path to set
* @return this Builder
* @deprecated use Builder.config instead.
*/
@Deprecated
public Builder view(final Path view) {
configBuilder.view(view);
return this;
}

/**
* @param view the graph view input stream to set
* @return this Builder
* @deprecated use Builder.config instead.
*/
@Deprecated
public Builder view(final InputStream view) {
configBuilder.view(view);
return this;
}

/**
* @param view the graph view URI to set
* @return this Builder
* @deprecated use Builder.config instead.
*/
@Deprecated
public Builder view(final URI view) {
configBuilder.view(view);
return this;
}

/**
* @param jsonBytes the graph view json bytes to set
* @return this Builder
* @deprecated use Builder.config instead.
*/
@Deprecated
public Builder view(final byte[] jsonBytes) {
configBuilder.view(jsonBytes);
return this;
}

public Builder description(final String description) {
configBuilder.description(description);
return this;
Expand Down Expand Up @@ -885,67 +807,6 @@ public Builder store(final Store store) {
return this;
}

/**
* @param hooksPath the graph hooks path
* @return this Builder
* @deprecated use Builder.config instead.
*/
@Deprecated
public Builder addHooks(final Path hooksPath) {
if (null == hooksPath || !hooksPath.toFile().exists()) {
throw new IllegalArgumentException("Unable to find graph hooks file: " + hooksPath);
}
final GraphHook[] hooks;
try {
hooks = JSONSerialiser.deserialise(FileUtils.readFileToByteArray(hooksPath.toFile()), GraphHook[].class);
} catch (final IOException e) {
throw new IllegalArgumentException("Unable to load graph hooks file: " + hooksPath, e);
}
return addHooks(hooks);
}

/**
* @param hookPath the graph hook path
* @return this Builder
* @deprecated use Builder.config instead.
*/
@Deprecated
public Builder addHook(final Path hookPath) {
if (null == hookPath || !hookPath.toFile().exists()) {
throw new IllegalArgumentException("Unable to find graph hook file: " + hookPath);
}

final GraphHook hook;
try {
hook = JSONSerialiser.deserialise(FileUtils.readFileToByteArray(hookPath.toFile()), GraphHook.class);
} catch (final IOException e) {
throw new IllegalArgumentException("Unable to load graph hook file: " + hookPath, e);
}
return addHook(hook);
}

/**
* @param graphHook the graph hook to add
* @return this Builder
* @deprecated use Builder.config instead.
*/
@Deprecated
public Builder addHook(final GraphHook graphHook) {
configBuilder.addHook(graphHook);
return this;
}

/**
* @param graphHooks the graph hooks to add
* @return this Builder
* @deprecated use Builder.config instead.
*/
@Deprecated
public Builder addHooks(final GraphHook... graphHooks) {
configBuilder.addHooks(graphHooks);
return this;
}

public Graph build() {
final GraphConfig config = configBuilder.build();
if (null == config.getLibrary()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ public Builder merge(final GraphConfig config) {
if (null != config.getView()) {
this.config.setView(config.getView());
}
if (null != config.getLibrary()) {
if (null != config.getLibrary() && !(config.getLibrary() instanceof NoGraphLibrary)) {
this.config.setLibrary(config.getLibrary());
}
if (null != config.getDescription()) {
Expand Down
44 changes: 28 additions & 16 deletions core/graph/src/test/java/uk/gov/gchq/gaffer/graph/GraphTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
import uk.gov.gchq.gaffer.operation.io.Output;
import uk.gov.gchq.gaffer.serialisation.Serialiser;
import uk.gov.gchq.gaffer.serialisation.ToBytesSerialiser;
import uk.gov.gchq.gaffer.serialisation.implementation.raw.RawDoubleSerialiser;
import uk.gov.gchq.gaffer.serialisation.implementation.ordered.OrderedDoubleSerialiser;
import uk.gov.gchq.gaffer.store.Context;
import uk.gov.gchq.gaffer.store.Store;
import uk.gov.gchq.gaffer.store.StoreProperties;
Expand Down Expand Up @@ -1134,7 +1134,7 @@ public void shouldThrowExceptionIfSchemaIsInvalid() throws OperationException {
.clazz(Integer.class)
.aggregateFunction(new Sum())
// invalid serialiser
.serialiser(new RawDoubleSerialiser())
.serialiser(new OrderedDoubleSerialiser())
.build())
.type("string", new TypeDefinition.Builder()
.clazz(String.class)
Expand Down Expand Up @@ -1417,12 +1417,14 @@ public void shouldAddHookAndGetGraphHooks() throws Exception {

// When
final Graph graph = new Graph.Builder()
.graphId("graphId")
.config(new GraphConfig.Builder()
.graphId("graphId")
.addHook(graphHook1)
.addHook(graphHook2)
.addHook(graphHook3)
.build())
.storeProperties(storeProperties)
.addSchemas(StreamUtil.schemas(getClass()))
.addHook(graphHook1)
.addHook(graphHook2)
.addHook(graphHook3)
.build();

// Then
Expand Down Expand Up @@ -1558,14 +1560,18 @@ public void shouldBuildGraphFromConfigAndMergeConfigWithExistingConfig() throws
.build();

final Graph graph = new Graph.Builder()
.graphId(graphId1)
.library(library1)
.view(view1)
.config(new GraphConfig.Builder()
.graphId(graphId1)
.library(library1)
.view(view1)
.addHook(hook1)
.build())
.storeProperties(storeProperties)
.addSchemas(StreamUtil.schemas(getClass()))
.addHook(hook1)
.config(config)
.addHook(hook3)
.config(new GraphConfig.Builder()
.addHook(hook3)
.build())
.build();

// Then
Expand Down Expand Up @@ -1605,13 +1611,19 @@ public void shouldBuildGraphFromConfigAndOverrideFields() throws Exception {

final Graph graph = new Graph.Builder()
.config(config)
.graphId(graphId1)
.library(library1)
.view(view1)
.config(new GraphConfig.Builder()
.graphId(graphId1)
.library(library1)
.view(view1)
.build())
.storeProperties(storeProperties)
.addSchemas(StreamUtil.schemas(getClass()))
.addHook(hook1)
.addHook(hook3)
.config(new GraphConfig.Builder()
.addHook(hook1)
.build())
.config(new GraphConfig.Builder()
.addHook(hook3)
.build())
.build();

// Then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@

import uk.gov.gchq.gaffer.commonutil.TestGroups;
import uk.gov.gchq.gaffer.commonutil.TestPropertyNames;
import uk.gov.gchq.gaffer.commonutil.TestTypes;
import uk.gov.gchq.gaffer.data.elementdefinition.view.View;
import uk.gov.gchq.gaffer.integration.store.TestStore;
import uk.gov.gchq.gaffer.operation.OperationChain;
import uk.gov.gchq.gaffer.operation.impl.add.AddElements;
import uk.gov.gchq.gaffer.operation.impl.add.AddElementsFromSocket;
import uk.gov.gchq.gaffer.operation.impl.get.GetElements;
import uk.gov.gchq.gaffer.store.StoreProperties;
import uk.gov.gchq.gaffer.store.TestTypes;
import uk.gov.gchq.gaffer.store.schema.Schema;
import uk.gov.gchq.gaffer.store.schema.SchemaEdgeDefinition;
import uk.gov.gchq.gaffer.store.schema.TypeDefinition;
Expand Down
2 changes: 1 addition & 1 deletion core/graph/src/test/resources/additionalOperations.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"class": "uk.gov.gchq.gaffer.operation.impl.DiscardOutput"
},
{
"class": "uk.gov.gchq.gaffer.operation.impl.SplitStore"
"class": "uk.gov.gchq.gaffer.operation.impl.SplitStoreFromFile"
}
],
"end": [
Expand Down
Loading