You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ha...@apache.org on 2021/08/17 05:34:39 UTC
[iotdb] 03/03: spotless
This is an automated email from the ASF dual-hosted git repository.
haonan pushed a commit to branch set_read_only
in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit 39b205d1c6780b61b47d864ebb396f0eb2b830a8
Author: HTHou <hh...@outlook.com>
AuthorDate: Tue Aug 17 13:33:29 2021 +0800
spotless
---
.../org/apache/iotdb/db/service/TSServiceImpl.java | 3 ++-
.../IoTDBSetSystemReadOnlyWritableIT.java | 30 ++++++++++------------
2 files changed, 16 insertions(+), 17 deletions(-)
diff --git a/server/src/main/java/org/apache/iotdb/db/service/TSServiceImpl.java b/server/src/main/java/org/apache/iotdb/db/service/TSServiceImpl.java
index e28f9cf..b3cf8e6 100644
--- a/server/src/main/java/org/apache/iotdb/db/service/TSServiceImpl.java
+++ b/server/src/main/java/org/apache/iotdb/db/service/TSServiceImpl.java
@@ -1133,7 +1133,8 @@ public class TSServiceImpl implements TSIService.Iface {
private boolean executeNonQuery(PhysicalPlan plan)
throws QueryProcessException, StorageGroupNotSetException, StorageEngineException {
- if (!(plan instanceof SetReadOnlyPlan) && IoTDBDescriptor.getInstance().getConfig().isReadOnly()) {
+ if (!(plan instanceof SetReadOnlyPlan)
+ && IoTDBDescriptor.getInstance().getConfig().isReadOnly()) {
throw new QueryProcessException(
"Current system mode is read-only, does not support non-query operation");
}
diff --git a/server/src/test/java/org/apache/iotdb/db/integration/IoTDBSetSystemReadOnlyWritableIT.java b/server/src/test/java/org/apache/iotdb/db/integration/IoTDBSetSystemReadOnlyWritableIT.java
index b2fa53f..88dec12 100644
--- a/server/src/test/java/org/apache/iotdb/db/integration/IoTDBSetSystemReadOnlyWritableIT.java
+++ b/server/src/test/java/org/apache/iotdb/db/integration/IoTDBSetSystemReadOnlyWritableIT.java
@@ -16,11 +16,9 @@
* specific language governing permissions and limitations
* under the License.
*/
+
package org.apache.iotdb.db.integration;
-import org.apache.iotdb.db.engine.cache.ChunkCache;
-import org.apache.iotdb.db.engine.cache.TimeSeriesMetadataCache;
-import org.apache.iotdb.db.exception.StorageEngineException;
import org.apache.iotdb.db.utils.EnvironmentUtils;
import org.apache.iotdb.jdbc.Config;
@@ -28,6 +26,7 @@ import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
+
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
@@ -39,10 +38,7 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import java.util.concurrent.TimeUnit;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
public class IoTDBSetSystemReadOnlyWritableIT {
@@ -60,7 +56,7 @@ public class IoTDBSetSystemReadOnlyWritableIT {
"insert into root.ln.wf01.wt01(timestamp,status) values(1509465960000,false)",
"insert into root.ln.wf01.wt01(timestamp,status) values(1509466020000,false)",
"insert into root.ln.wf01.wt01(timestamp,status) values(1509466080000,false)",
- };
+ };
private static final String[] sqls2 =
new String[] {
@@ -124,7 +120,6 @@ public class IoTDBSetSystemReadOnlyWritableIT {
"flush"
};
-
@BeforeClass
public static void setUp() throws Exception {
EnvironmentUtils.closeStatMonitor();
@@ -166,18 +161,21 @@ public class IoTDBSetSystemReadOnlyWritableIT {
e.printStackTrace();
fail(e.getMessage());
}
- try (
- Connection connection = DriverManager
- .getConnection(Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", "root", "root");
+ try (Connection connection =
+ DriverManager.getConnection(
+ Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", "root", "root");
Statement statement = connection.createStatement()) {
- statement.execute("insert into root.ln.wf01.wt01(timestamp,status) values(1509466140000,false)");
+ statement.execute(
+ "insert into root.ln.wf01.wt01(timestamp,status) values(1509466140000,false)");
fail();
} catch (Exception e) {
- Assert.assertEquals("411: Current system mode is read-only, does not support non-query operation", e.getMessage());
+ Assert.assertEquals(
+ "411: Current system mode is read-only, does not support non-query operation",
+ e.getMessage());
}
- try (
- Connection connection = DriverManager
- .getConnection(Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", "root", "root");
+ try (Connection connection =
+ DriverManager.getConnection(
+ Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", "root", "root");
Statement statement = connection.createStatement()) {
statement.execute("SET SYSTEM TO WRITABLE");
} catch (Exception e) {