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

Reformat all java files #1627

Merged
Merged
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
  •  
  •  
  •  
9 changes: 9 additions & 0 deletions cuebot/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ plugins {
id('com.google.protobuf') version "0.9.1"
id('jacoco')
id('org.sonarqube') version "2.8"
id('com.diffplug.spotless') version "5.16.0"
}

sourceCompatibility = 11
Expand Down Expand Up @@ -171,3 +172,11 @@ test {
}
}
}

spotless {
java {
targetExclude 'src/compiled_protobuf/**'
toggleOffOn()
eclipse().configFile('jdtls.xml')
}
}
67 changes: 0 additions & 67 deletions cuebot/code_style_ij.xml

This file was deleted.

337 changes: 337 additions & 0 deletions cuebot/jdtls.xml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,19 @@
import io.grpc.ServerCallHandler;
import io.grpc.ServerInterceptor;
import io.grpc.Status;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;

import org.apache.logging.log4j.Logger;

public class CueServerInterceptor implements ServerInterceptor {

private static final Logger logger = LogManager.getLogger(CueServerInterceptor.class);
private static final Logger accessLogger = LogManager.getLogger("API");

@Override
public <ReqT, RespT> ServerCall.Listener<ReqT> interceptCall(
ServerCall<ReqT, RespT> serverCall, Metadata metadata,
ServerCallHandler<ReqT, RespT> serverCallHandler) {
accessLogger.info("gRPC [" +
serverCall.getAttributes().get(Grpc.TRANSPORT_ATTR_REMOTE_ADDR) +
"]: " + serverCall.getMethodDescriptor().getFullMethodName());
public <ReqT, RespT> ServerCall.Listener<ReqT> interceptCall(ServerCall<ReqT, RespT> serverCall,
Metadata metadata, ServerCallHandler<ReqT, RespT> serverCallHandler) {
accessLogger.info("gRPC [" + serverCall.getAttributes().get(Grpc.TRANSPORT_ATTR_REMOTE_ADDR)
+ "]: " + serverCall.getMethodDescriptor().getFullMethodName());

ServerCall.Listener<ReqT> delegate = serverCallHandler.startCall(serverCall, metadata);
return new SimpleForwardingServerCallListener<ReqT>(delegate) {
Expand All @@ -32,10 +29,8 @@ public void onHalfClose() {
super.onHalfClose();
} catch (Exception e) {
logger.error("Caught an unexpected error.", e);
serverCall.close(Status.INTERNAL
.withCause(e)
.withDescription(e.toString() + "\n" + e.getMessage()),
new Metadata());
serverCall.close(Status.INTERNAL.withCause(e)
.withDescription(e.toString() + "\n" + e.getMessage()), new Metadata());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
import com.imageworks.spcue.servant.ManageTask;
import com.imageworks.spcue.servant.RqdReportStatic;


public class GrpcServer implements ApplicationContextAware {

private static final Logger logger = LogManager.getLogger(GrpcServer.class);
Expand Down Expand Up @@ -72,8 +71,7 @@ public void shutdown() {
}

public void start() throws IOException {
server = ServerBuilder
.forPort(this.port)
server = ServerBuilder.forPort(this.port)
.addService(applicationContext.getBean("rqdReportStatic", RqdReportStatic.class))
.addService(applicationContext.getBean("cueStaticServant", CueStatic.class))
.addService(applicationContext.getBean("manageAction", ManageAction.class))
Expand All @@ -93,14 +91,16 @@ public void start() throws IOException {
.addService(applicationContext.getBean("manageMatcher", ManageMatcher.class))
.addService(applicationContext.getBean("manageOwner", ManageOwner.class))
.addService(applicationContext.getBean("manageProc", ManageProc.class))
.addService(applicationContext.getBean("manageRenderPartition", ManageRenderPartition.class))
.addService(applicationContext.getBean("manageRenderPartition",
ManageRenderPartition.class))
.addService(applicationContext.getBean("manageService", ManageService.class))
.addService(applicationContext.getBean("manageServiceOverride", ManageServiceOverride.class))
.addService(applicationContext.getBean("manageServiceOverride",
ManageServiceOverride.class))
.addService(applicationContext.getBean("manageShow", ManageShow.class))
.addService(applicationContext.getBean("manageSubscription", ManageSubscription.class))
.addService(
applicationContext.getBean("manageSubscription", ManageSubscription.class))
.addService(applicationContext.getBean("manageTask", ManageTask.class))
.maxInboundMessageSize(maxMessageBytes)
.intercept(new CueServerInterceptor())
.maxInboundMessageSize(maxMessageBytes).intercept(new CueServerInterceptor())
.build();
server.start();
logger.info("gRPC server started on " + this.name + " at port " + this.port + " !");
Expand Down
21 changes: 8 additions & 13 deletions cuebot/src/main/java/com/imageworks/spcue/ActionEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,17 @@
/*
* Copyright Contributors to the OpenCue Project
*
* 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
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/



package com.imageworks.spcue;

import com.imageworks.spcue.grpc.filter.Action;
Expand Down Expand Up @@ -85,7 +81,7 @@ public String getActionId() {
}

public String getFilterId() {
if (filterId == null){
if (filterId == null) {
throw new SpcueRuntimeException(
"Trying to get a filterId from a ActityEntity created without a filter");
}
Expand All @@ -97,4 +93,3 @@ public String getShowId() {
}

}

19 changes: 7 additions & 12 deletions cuebot/src/main/java/com/imageworks/spcue/ActionInterface.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,21 @@
/*
* Copyright Contributors to the OpenCue Project
*
* 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
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/



package com.imageworks.spcue;

public interface ActionInterface extends FilterInterface {

public String getActionId();

}

19 changes: 7 additions & 12 deletions cuebot/src/main/java/com/imageworks/spcue/AllocationEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,17 @@
/*
* Copyright Contributors to the OpenCue Project
*
* 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
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/



package com.imageworks.spcue;

public class AllocationEntity extends Entity implements AllocationInterface {
Expand All @@ -34,4 +30,3 @@ public String getFacilityId() {
}

}

Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,20 @@
/*
* Copyright Contributors to the OpenCue Project
*
* 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
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/



package com.imageworks.spcue;

public interface AllocationInterface extends EntityInterface, FacilityInterface {

public String getAllocationId();
}

Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,17 @@
/*
* Copyright Contributors to the OpenCue Project
*
* 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
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/



package com.imageworks.spcue;

import com.imageworks.spcue.grpc.depend.DependType;
Expand Down Expand Up @@ -120,4 +116,3 @@ public void setLaunchDepend(boolean launchDepend) {
}

}

Loading