diff --git a/conf/smart-default.xml b/conf/smart-default.xml
index fc74671e76e..a70401a960f 100644
--- a/conf/smart-default.xml
+++ b/conf/smart-default.xml
@@ -391,4 +391,84 @@
Comma-separated list of regex templates of internal files to be completely ignored by SSM.
+
+
+ smart.access.count.day.tables.num
+ 30
+
+ The max number of access count per day tables in the Metastore.
+
+
+
+
+ smart.access.count.hour.tables.num
+ 48
+
+ The max number of access count per hour tables in the Metastore.
+
+
+
+
+ smart.access.count.minute.tables.num
+ 120
+
+ The max number of access count per minute tables in the Metastore.
+
+
+
+
+ smart.access.count.second.tables.num
+ 30
+
+ The max number of access count per second tables in the Metastore.
+
+
+
+
+ smart.access.event.fetch.interval.ms
+ 1000
+
+ The interval in milliseconds between access event fetches.
+
+
+
+
+ smart.cached.file.fetch.interval.ms
+ 5000
+
+ The interval in milliseconds between cached files fetches from HDFS.
+
+
+
+
+ smart.namespace.fetch.interval.ms
+ 1
+
+ The interval in milliseconds between namespace fetches from HDFS.
+
+
+
+
+ smart.mover.scheduler.storage.report.fetch.interval.ms
+ 120000
+
+ The interval in milliseconds between storage report fetches from HDFS DataNode in mover scheduler.
+
+
+
+
+ smart.metastore.small-file.insert.batch.size
+ 200
+
+ The max size of small file insert batch to the Metastore.
+
+
+
+
+ smart.agent.master.ask.timeout.ms
+ 5000
+
+ The max time in milliseconds to wait an answer from the SmartAgent master actor during action submission.
+
+
diff --git a/smart-common/src/main/java/org/smartdata/conf/SmartConfKeys.java b/smart-common/src/main/java/org/smartdata/conf/SmartConfKeys.java
index ad721d898cf..9caac0aa7c6 100644
--- a/smart-common/src/main/java/org/smartdata/conf/SmartConfKeys.java
+++ b/smart-common/src/main/java/org/smartdata/conf/SmartConfKeys.java
@@ -90,6 +90,34 @@ public class SmartConfKeys {
"smart.metastore.mysql.legacy.enabled";
public static final boolean SMART_METASTORE_LEGACY_MYSQL_SUPPORT_DEFAULT = false;
+ public static final String SMART_NUM_DAY_TABLES_TO_KEEP_KEY =
+ "smart.access.count.day.tables.num";
+ public static final int SMART_NUM_DAY_TABLES_TO_KEEP_DEFAULT = 30;
+
+ public static final String SMART_NUM_HOUR_TABLES_TO_KEEP_KEY =
+ "smart.access.count.hour.tables.num";
+ public static final int SMART_NUM_HOUR_TABLES_TO_KEEP_DEFAULT = 48;
+
+ public static final String SMART_NUM_MINUTE_TABLES_TO_KEEP_KEY =
+ "smart.access.count.minute.tables.num";
+ public static final int SMART_NUM_MINUTE_TABLES_TO_KEEP_DEFAULT = 120;
+
+ public static final String SMART_NUM_SECOND_TABLES_TO_KEEP_KEY =
+ "smart.access.count.second.tables.num";
+ public static final int SMART_NUM_SECOND_TABLES_TO_KEEP_DEFAULT = 30;
+
+ public static final String SMART_ACCESS_EVENT_FETCH_INTERVAL_MS_KEY =
+ "smart.access.event.fetch.interval.ms";
+ public static final long SMART_ACCESS_EVENT_FETCH_INTERVAL_MS_DEFAULT = 1000L;
+
+ public static final String SMART_CACHED_FILE_FETCH_INTERVAL_MS_KEY =
+ "smart.cached.file.fetch.interval.ms";
+ public static final long SMART_CACHED_FILE_FETCH_INTERVAL_MS_DEFAULT = 5 * 1000L;
+
+ public static final String SMART_NAMESPACE_FETCH_INTERVAL_MS_KEY =
+ "smart.namespace.fetch.interval.ms";
+ public static final long SMART_NAMESPACE_FETCH_INTERVAL_MS_DEFAULT = 1L;
+
// StatesManager
// RuleManager
@@ -140,6 +168,14 @@ public class SmartConfKeys {
public static final int SMART_FILE_DIFF_MAX_NUM_RECORDS_DEFAULT =
10000;
+ public static final String SMART_MOVER_SCHEDULER_REPORT_FETCH_INTERVAL_MS_KEY =
+ "smart.mover.scheduler.storage.report.fetch.interval.ms";
+ public static final long SMART_MOVER_SCHEDULER_REPORT_FETCH_INTERVAL_MS_DEFAULT = 2 * 60 * 1000;
+
+ public static final String SMART_SMALL_FILE_METASTORE_INSERT_BATCH_SIZE_KEY =
+ "smart.metastore.small-file.insert.batch.size";
+ public static final int SMART_SMALL_FILE_METASTORE_INSERT_BATCH_SIZE_DEFAULT = 200;
+
// Dispatcher
public static final String SMART_CMDLET_DISPATCHER_LOG_DISP_RESULT_KEY =
"smart.cmdlet.dispatcher.log.disp.result";
@@ -167,6 +203,10 @@ public class SmartConfKeys {
public static final String SMART_AGENT_PORT_KEY = "smart.agent.port";
public static final int SMART_AGENT_PORT_DEFAULT = 7048;
+ public static final String SMART_AGENT_MASTER_ASK_TIMEOUT_MS_KEY =
+ "smart.agent.master.ask.timeout.ms";
+ public static final long SMART_AGENT_MASTER_ASK_TIMEOUT_MS_DEFAULT = 5000L;
+
/** Do NOT configure the following two options manually. They are set by the boot scripts. **/
public static final String SMART_AGENT_MASTER_ADDRESS_KEY = "smart.agent.master.address";
public static final String SMART_AGENT_ADDRESS_KEY = "smart.agent.address";
diff --git a/smart-engine/src/main/java/org/smartdata/server/engine/StatesManager.java b/smart-engine/src/main/java/org/smartdata/server/engine/StatesManager.java
index 3b280de3af4..d53bbe2c494 100644
--- a/smart-engine/src/main/java/org/smartdata/server/engine/StatesManager.java
+++ b/smart-engine/src/main/java/org/smartdata/server/engine/StatesManager.java
@@ -75,7 +75,7 @@ public void init() throws IOException {
LOG.info("Initializing ...");
this.executorService = Executors.newScheduledThreadPool(4);
this.accessCountTableManager = new AccessCountTableManager(
- serverContext.getMetaStore(), executorService);
+ serverContext.getMetaStore(), executorService, serverContext.getConf());
this.fileAccessEventSource = MetricsFactory.createAccessEventSource(serverContext.getConf());
this.accessEventFetcher =
new AccessEventFetcher(
diff --git a/smart-engine/src/main/java/org/smartdata/server/engine/cmdlet/agent/AgentMaster.java b/smart-engine/src/main/java/org/smartdata/server/engine/cmdlet/agent/AgentMaster.java
index 08294fed593..d932c6ac9e6 100644
--- a/smart-engine/src/main/java/org/smartdata/server/engine/cmdlet/agent/AgentMaster.java
+++ b/smart-engine/src/main/java/org/smartdata/server/engine/cmdlet/agent/AgentMaster.java
@@ -53,11 +53,13 @@
import scala.concurrent.Future;
import scala.concurrent.duration.Duration;
+import static org.smartdata.conf.SmartConfKeys.SMART_AGENT_MASTER_ASK_TIMEOUT_MS_DEFAULT;
+import static org.smartdata.conf.SmartConfKeys.SMART_AGENT_MASTER_ASK_TIMEOUT_MS_KEY;
+
public class AgentMaster {
private static final Logger LOG = LoggerFactory.getLogger(AgentMaster.class);
- public static final Timeout TIMEOUT =
- new Timeout(Duration.create(5, TimeUnit.SECONDS));
+ public Timeout masterAskTimeout;
private ActorSystem system;
private ActorRef master;
@@ -71,6 +73,13 @@ private AgentMaster(SmartConf conf) throws IOException {
if (addresses == null) {
throw new IOException("AgentMaster address not configured!");
}
+
+ long masterAskTimeoutMs = conf.getLong(
+ SMART_AGENT_MASTER_ASK_TIMEOUT_MS_KEY,
+ SMART_AGENT_MASTER_ASK_TIMEOUT_MS_DEFAULT
+ );
+ masterAskTimeout = new Timeout(Duration.create(masterAskTimeoutMs, TimeUnit.MILLISECONDS));
+
String address = addresses[0];
LOG.info("Agent master: " + address);
Config config = AgentUtils.overrideRemoteAddress(
@@ -159,8 +168,8 @@ ActorRef getMasterActor() {
}
Object askMaster(Object message) throws Exception {
- Future