Skip to content
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you 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. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

package org.apache.iotdb.confignode.it;

import org.apache.iotdb.consensus.ConsensusFactory;
import org.apache.iotdb.it.env.EnvFactory;
import org.apache.iotdb.it.framework.IoTDBTestRunner;
import org.apache.iotdb.itbase.category.ClusterIT;

import org.junit.Before;
import org.junit.experimental.categories.Category;
import org.junit.runner.RunWith;

@RunWith(IoTDBTestRunner.class)
@Category({ClusterIT.class})
public class IoTDBConfigNodeSnapshot2IT extends IoTDBConfigNodeSnapshotIT {
@Before
public void setUp() throws Exception {
// set setConfigNodeRatisSnapshotTriggerThreshold to 1
EnvFactory.getEnv()
.getConfig()
.getCommonConfig()
.setConfigNodeConsensusProtocolClass(ConsensusFactory.RATIS_CONSENSUS)
.setConfigNodeRatisSnapshotTriggerThreshold(1)
.setTimePartitionInterval(testTimePartitionInterval);

// Init 2C2D cluster environment
EnvFactory.getEnv().initClusterEnvironment(2, 2);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,15 @@
@RunWith(IoTDBTestRunner.class)
@Category({ClusterIT.class})
public class IoTDBConfigNodeSnapshotIT {
private static final int testRatisSnapshotTriggerThreshold = 100;
private static final long testTimePartitionInterval = 86400;
protected final long testTimePartitionInterval = 86400;

@Before
public void setUp() throws Exception {
EnvFactory.getEnv()
.getConfig()
.getCommonConfig()
.setConfigNodeConsensusProtocolClass(ConsensusFactory.RATIS_CONSENSUS)
.setConfigNodeRatisSnapshotTriggerThreshold(testRatisSnapshotTriggerThreshold)
.setConfigNodeRatisSnapshotTriggerThreshold(100)
.setTimePartitionInterval(testTimePartitionInterval);

// Init 2C2D cluster environment
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,6 @@ public boolean processTakeSnapshot(File snapshotDir) throws TException, IOExcept
return false;
}

acquireTriggerTableLock();
try (FileOutputStream fileOutputStream = new FileOutputStream(snapshotFile)) {

serializeExistedJarToMD5(fileOutputStream);
Expand All @@ -257,8 +256,6 @@ public boolean processTakeSnapshot(File snapshotDir) throws TException, IOExcept
// fsync
fileOutputStream.getFD().sync();
return true;
} finally {
releaseTriggerTableLock();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,6 @@ public boolean processTakeSnapshot(File snapshotDir) throws IOException {
return false;
}

acquireUDFTableLock();
try (FileOutputStream fileOutputStream = new FileOutputStream(snapshotFile)) {

serializeExistedJarToMD5(fileOutputStream);
Expand All @@ -205,8 +204,6 @@ public boolean processTakeSnapshot(File snapshotDir) throws IOException {
fileOutputStream.getFD().sync();

return true;
} finally {
releaseUDFTableLock();
}
}

Expand Down