X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=auth%2Fauth-batch%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Faaf%2Fauth%2Fbatch%2Fhelpers%2FCQLBatch.java;h=a045b74a1cdb6981c87ccb40d43ea913e6321ba9;hb=0598a034592fdfb0bf7a971066f325e7b6594994;hp=d62c77811291a10ed5131f861caf3af13eb54d86;hpb=1aba148a7ff88c8f43762da19fa4c757c62732c5;p=aaf%2Fauthz.git diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/CQLBatch.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/CQLBatch.java index d62c7781..a045b74a 100644 --- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/CQLBatch.java +++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/CQLBatch.java @@ -7,9 +7,9 @@ * 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 - * + * * 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. @@ -20,7 +20,6 @@ package org.onap.aaf.auth.batch.helpers; -import org.onap.aaf.cadi.Access; import org.onap.aaf.misc.env.LogTarget; import com.datastax.driver.core.ResultSet; @@ -47,7 +46,7 @@ public class CQLBatch { hasAdded = sb.length(); return sb; } - + private boolean end() { if(sb.length()==hasAdded) { return false; @@ -57,7 +56,7 @@ public class CQLBatch { return true; } } - + public ResultSet execute() { if(end()) { if(sleep>0) { @@ -66,17 +65,19 @@ public class CQLBatch { try { Thread.sleep(left); } catch (InterruptedException e) { - Access.NULL.log(e); // Keep code check idiocy at bay + // PER ORACLE, this isn't actually needed, but Sonar idiocy + // requires something or flags as error. + Thread.currentThread().interrupt(); } } - last = System.currentTimeMillis()+sleep; + last = System.currentTimeMillis() + sleep; } return session.execute(sb.toString()); } else { return null; } } - + public ResultSet execute(boolean dryRun) { ResultSet rv = null; if(dryRun) { @@ -86,10 +87,12 @@ public class CQLBatch { try { Thread.sleep(left); } catch (InterruptedException e) { - Access.NULL.log(e); // Keep code check idiocy at bay + // PER ORACLE, this isn't actually needed, but Sonar idiocy + // requires something or flags as error. + Thread.currentThread().interrupt(); } } - last = System.currentTimeMillis()+sleep; + last = System.currentTimeMillis() + sleep; } end(); } else { @@ -98,7 +101,7 @@ public class CQLBatch { sb.setLength(0); return rv; } - + public ResultSet singleExec(StringBuilder query, boolean dryRun) { if(dryRun) { return null; @@ -106,10 +109,10 @@ public class CQLBatch { return session.execute(query.toString()); } } - + public void touch(String table, int begin, int end, boolean dryRun) { StringBuilder sb = begin(); - for(int i=begin;i