http://git-wip-us.apache.org/repos/asf/accumulo/blob/0ca5cd33/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/ServersShuttingDown.java ---------------------------------------------------------------------- diff --git a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/ServersShuttingDown.java b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/ServersShuttingDown.java deleted file mode 100644 index 8fbb541..0000000 --- a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/ServersShuttingDown.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * 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.accumulo.monitor.rest.api; - -import java.util.ArrayList; -import java.util.List; - -public class ServersShuttingDown { - - public List<ServerShuttingDownInformation> server; - - public ServersShuttingDown() { - server = new ArrayList<>(); - } - - public void addServerShuttingDown(ServerShuttingDownInformation server) { - this.server.add(server); - } -}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/0ca5cd33/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/TableInformation.java ---------------------------------------------------------------------- diff --git a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/TableInformation.java b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/TableInformation.java deleted file mode 100644 index c09dcbd..0000000 --- a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/TableInformation.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * 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.accumulo.monitor.rest.api; - -import org.apache.accumulo.core.master.thrift.TableInfo; - -public class TableInformation { - - public String tablename, tableId, tableState; - - public int tablets, onlineTablets; - public long recs, recsInMemory; - - public double ingest, ingestByteRate, query, queryByteRate; - - public CompactionsList majorCompactions, minorCompactions, scans; - - private int queuedMajorCompactions, runningMajorCompactions, queuedMinorCompactions, runningMinorCompactions, queuedScans, runningScans; - - public double entriesRead, entriesReturned; - public Double holdTime; - - public int offlineTablets; - - public TableInformation() {} - - public TableInformation(String tableName, String tableId, String tableState) { - this.tablename = tableName; - this.tableId = tableId; - this.tableState = tableState; - } - - public TableInformation(String tableName, String tableId, TableInfo info, Double holdTime, String tableState) { - this.tablename = tableName; - this.tableId = tableId; - - this.tablets = info.tablets; - this.offlineTablets = info.tablets - info.onlineTablets; - this.onlineTablets = info.onlineTablets; - - this.recs = info.recs; - this.recsInMemory = info.recsInMemory; - - this.ingest = info.getIngestRate(); - this.ingestByteRate = info.getIngestByteRate(); - - this.query = info.getQueryRate(); - this.queryByteRate = info.getQueryByteRate(); - - this.entriesRead = info.scanRate; - this.entriesReturned = info.queryRate; - - this.holdTime = holdTime; - - if (null != info.scans) { - this.queuedScans = info.scans.queued; - this.runningScans = info.scans.running; - } else { - this.queuedScans = 0; - this.runningScans = 0; - } - - if (null != info.minors) { - this.queuedMinorCompactions = info.minors.queued; - this.runningMinorCompactions = info.minors.running; - } else { - this.queuedMinorCompactions = 0; - this.runningMinorCompactions = 0; - } - - if (null != info.majors) { - this.queuedMajorCompactions = info.majors.queued; - this.runningMajorCompactions = info.majors.running; - } else { - this.queuedMajorCompactions = 0; - this.runningMajorCompactions = 0; - } - - this.majorCompactions = new CompactionsList(runningMajorCompactions, queuedMajorCompactions); - this.minorCompactions = new CompactionsList(runningMinorCompactions, queuedMinorCompactions); - this.scans = new CompactionsList(runningScans, queuedScans); - - this.tableState = tableState; - } -} http://git-wip-us.apache.org/repos/asf/accumulo/blob/0ca5cd33/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/TableInformationList.java ---------------------------------------------------------------------- diff --git a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/TableInformationList.java b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/TableInformationList.java deleted file mode 100644 index 02d6e81..0000000 --- a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/TableInformationList.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * 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.accumulo.monitor.rest.api; - -import java.util.ArrayList; -import java.util.List; - -public class TableInformationList { - - public List<TableInformation> table; - - public TableInformationList() { - table = new ArrayList<>(); - } - - public void addTable(TableInformation table) { - this.table.add(table); - } -} http://git-wip-us.apache.org/repos/asf/accumulo/blob/0ca5cd33/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/TableNamespace.java ---------------------------------------------------------------------- diff --git a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/TableNamespace.java b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/TableNamespace.java deleted file mode 100644 index 967657d..0000000 --- a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/TableNamespace.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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.accumulo.monitor.rest.api; - -import java.util.ArrayList; -import java.util.List; - -public class TableNamespace { - - public String namespace; - public List<TableInformation> table; - - public TableNamespace() {} - - public TableNamespace(String name) { - namespace = name; - table = new ArrayList<>(); - } - - public void addTable(TableInformation table) { - this.table.add(table); - } -} http://git-wip-us.apache.org/repos/asf/accumulo/blob/0ca5cd33/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/TablesList.java ---------------------------------------------------------------------- diff --git a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/TablesList.java b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/TablesList.java deleted file mode 100644 index ce6dbba..0000000 --- a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/TablesList.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * 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.accumulo.monitor.rest.api; - -import java.util.ArrayList; -import java.util.List; - -public class TablesList { - - public List<TableNamespace> tables; - - public TablesList() { - tables = new ArrayList<>(); - } - - public void addTable(TableNamespace table) { - tables.add(table); - } -} http://git-wip-us.apache.org/repos/asf/accumulo/blob/0ca5cd33/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/TabletServer.java ---------------------------------------------------------------------- diff --git a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/TabletServer.java b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/TabletServer.java deleted file mode 100644 index bf388f8..0000000 --- a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/TabletServer.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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.accumulo.monitor.rest.api; - -import org.apache.accumulo.core.master.thrift.TableInfo; -import org.apache.accumulo.core.master.thrift.TabletServerStatus; - -/** - * To use for XML Resource - */ -public class TabletServer { - - public TabletServerInformation server; - - public TabletServer() { - server = new TabletServerInformation(); - } - - public TabletServer(TabletServerInformation server) { - this.server = server; - } - - public TabletServer(TabletServerStatus status) { - server = new TabletServerInformation(status); - } - - public void updateTabletServerInfo(TabletServerStatus status, TableInfo summary) { - server.updateTabletServerInfo(status, summary); - } -} http://git-wip-us.apache.org/repos/asf/accumulo/blob/0ca5cd33/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/TabletServerBulkImportInformation.java ---------------------------------------------------------------------- diff --git a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/TabletServerBulkImportInformation.java b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/TabletServerBulkImportInformation.java deleted file mode 100644 index 6b93275..0000000 --- a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/TabletServerBulkImportInformation.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * 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.accumulo.monitor.rest.api; - -import org.apache.accumulo.core.master.thrift.TabletServerStatus; - -public class TabletServerBulkImportInformation { - - public String server; - public int importSize; - public long oldestAge; - - public TabletServerBulkImportInformation() {} - - public TabletServerBulkImportInformation(TabletServerStatus server, int importSize, long oldestAge) { - this.server = server.getName(); - this.importSize = importSize; - this.oldestAge = oldestAge; - } -} http://git-wip-us.apache.org/repos/asf/accumulo/blob/0ca5cd33/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/TabletServerDetailInformation.java ---------------------------------------------------------------------- diff --git a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/TabletServerDetailInformation.java b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/TabletServerDetailInformation.java deleted file mode 100644 index 67079bd..0000000 --- a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/TabletServerDetailInformation.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * 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.accumulo.monitor.rest.api; - -public class TabletServerDetailInformation { - - public int hostedTablets, minors, majors, splits; - public long entries; - - public TabletServerDetailInformation() {} - - public TabletServerDetailInformation(int hostedTablets, long entries, int minors, int majors, int splits) { - this.hostedTablets = hostedTablets; - this.entries = entries; - this.minors = minors; - this.majors = majors; - this.splits = splits; - } -} http://git-wip-us.apache.org/repos/asf/accumulo/blob/0ca5cd33/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/TabletServerInformation.java ---------------------------------------------------------------------- diff --git a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/TabletServerInformation.java b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/TabletServerInformation.java deleted file mode 100644 index 2f7f6da..0000000 --- a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/TabletServerInformation.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * 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.accumulo.monitor.rest.api; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAttribute; - -import org.apache.accumulo.core.master.thrift.RecoveryStatus; -import org.apache.accumulo.core.master.thrift.TableInfo; -import org.apache.accumulo.core.master.thrift.TabletServerStatus; -import org.apache.accumulo.monitor.Monitor; -import org.apache.accumulo.server.util.TableInfoUtil; - -public class TabletServerInformation { - - @XmlAttribute(name = "id") - public String server; - - public String hostname; - public long lastContact; - public double osload; - - public CompactionsTypes compactions; - - public int tablets; - public double ingest, query, ingestMB, queryMB; - public Integer scans; // For backwards compatibility, has same information as scansRunning - public Double scansessions; - public Double scanssessions; // For backwards compatibility - public long holdtime; - - // New variables - - public String ip; - private Integer scansRunning, scansQueued, minorRunning, minorQueued, majorRunning, majorQueued; - private CompactionsList scansCompacting, major, minor; // if scans is removed, change scansCompacting to scans - public long entries, lookups, indexCacheHits, indexCacheRequests, dataCacheHits, dataCacheRequests; - public double indexCacheHitRate, dataCacheHitRate; - public List<RecoveryStatusInformation> logRecoveries; - - public TabletServerInformation() {} - - public TabletServerInformation(TabletServerStatus thriftStatus) { - TableInfo summary = TableInfoUtil.summarizeTableStats(thriftStatus); - updateTabletServerInfo(thriftStatus, summary); - } - - public void updateTabletServerInfo(TabletServerStatus thriftStatus, TableInfo summary) { - - long now = System.currentTimeMillis(); - - this.server = this.ip = this.hostname = thriftStatus.name; - this.tablets = summary.tablets; - this.lastContact = now - thriftStatus.lastContact; - this.entries = summary.recs; - this.ingest = summary.ingestRate; - this.query = summary.queryRate; - - this.holdtime = thriftStatus.holdTime; - - this.scansRunning = summary.scans != null ? summary.scans.running : null; - this.scansQueued = summary.scans != null ? summary.scans.queued : null; - - this.scans = this.scansRunning; - - this.scansCompacting = new CompactionsList(this.scansRunning, this.scansQueued); - - this.minorRunning = summary.minors != null ? summary.minors.running : null; - this.minorQueued = summary.minors != null ? summary.minors.running : null; - - this.minor = new CompactionsList(this.minorRunning, this.minorQueued); - - this.majorRunning = summary.majors != null ? summary.majors.running : null; - this.majorQueued = summary.majors != null ? summary.majors.running : null; - - this.major = new CompactionsList(this.majorRunning, this.majorQueued); - - this.compactions = new CompactionsTypes(scansCompacting, major, minor); - - this.osload = thriftStatus.osLoad; - this.lookups = thriftStatus.lookups; - - this.dataCacheHits = thriftStatus.dataCacheHits; - this.dataCacheRequests = thriftStatus.dataCacheRequest; - this.indexCacheHits = thriftStatus.indexCacheHits; - this.indexCacheRequests = thriftStatus.indexCacheRequest; - - this.indexCacheHitRate = this.indexCacheHits / (double) Math.max(this.indexCacheRequests, 1); - this.dataCacheHitRate = this.dataCacheHits / (double) Math.max(this.dataCacheRequests, 1); - - this.ingestMB = summary.ingestByteRate; - this.queryMB = summary.queryByteRate; - - this.scansessions = Monitor.getLookupRate(); - this.scanssessions = this.scansessions; // For backwards compatibility - - this.logRecoveries = new ArrayList<>(thriftStatus.logSorts.size()); - for (RecoveryStatus recovery : thriftStatus.logSorts) { - logRecoveries.add(new RecoveryStatusInformation(recovery)); - } - } -} http://git-wip-us.apache.org/repos/asf/accumulo/blob/0ca5cd33/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/TabletServerSummary.java ---------------------------------------------------------------------- diff --git a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/TabletServerSummary.java b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/TabletServerSummary.java deleted file mode 100644 index 9c99528..0000000 --- a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/TabletServerSummary.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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.accumulo.monitor.rest.api; - -import java.util.List; - -public class TabletServerSummary { - - public TabletServerDetailInformation details; - public List<AllTimeTabletResults> allTimeTabletResults; - public CurrentTabletResults currentTabletOperationResults; - public List<CurrentOperations> currentOperations; - - public TabletServerSummary() {} - - public TabletServerSummary(TabletServerDetailInformation details, List<AllTimeTabletResults> allTimeResults, CurrentTabletResults currentResults, - List<CurrentOperations> currentOperations) { - this.details = details; - this.allTimeTabletResults = allTimeResults; - this.currentTabletOperationResults = currentResults; - this.currentOperations = currentOperations; - } - - public void addcurrentOperations(CurrentOperations currentOperations) { - this.currentOperations.add(currentOperations); - } -} http://git-wip-us.apache.org/repos/asf/accumulo/blob/0ca5cd33/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/TabletServerWithTableInformation.java ---------------------------------------------------------------------- diff --git a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/TabletServerWithTableInformation.java b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/TabletServerWithTableInformation.java deleted file mode 100644 index a7d76b2..0000000 --- a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/TabletServerWithTableInformation.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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.accumulo.monitor.rest.api; - -public class TabletServerWithTableInformation { - - public TabletServerInformation tserver; - public TableInformation table; - - public TabletServerWithTableInformation(TabletServerInformation tserverInfo, TableInformation tableInfo) { - this.tserver = tserverInfo; - this.table = tableInfo; - } -} http://git-wip-us.apache.org/repos/asf/accumulo/blob/0ca5cd33/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/TabletServers.java ---------------------------------------------------------------------- diff --git a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/TabletServers.java b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/TabletServers.java deleted file mode 100644 index b43cba5..0000000 --- a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/TabletServers.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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.accumulo.monitor.rest.api; - -import java.util.ArrayList; -import java.util.List; - -public class TabletServers { - - public List<TabletServerInformation> servers; - - public TabletServers() { - servers = new ArrayList<>(); - } - - public TabletServers(int size) { - servers = new ArrayList<>(size); - } - - public void addTablet(TabletServer tablet) { - servers.add(tablet.server); - } -} http://git-wip-us.apache.org/repos/asf/accumulo/blob/0ca5cd33/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/Totals.java ---------------------------------------------------------------------- diff --git a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/Totals.java b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/Totals.java deleted file mode 100644 index b52a4e1..0000000 --- a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/Totals.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * 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.accumulo.monitor.rest.api; - -public class Totals { - - public double ingestrate, queryrate, diskrate = 0.0; - public long numentries; - - public Totals() { - ingestrate = 0.0; - queryrate = 0.0; - numentries = 0l; - } - - public Totals(double ingestrate, double queryrate, long numentries) { - this.ingestrate = ingestrate; - this.queryrate = queryrate; - this.numentries = numentries; - } -} http://git-wip-us.apache.org/repos/asf/accumulo/blob/0ca5cd33/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/TraceInformation.java ---------------------------------------------------------------------- diff --git a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/TraceInformation.java b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/TraceInformation.java deleted file mode 100644 index b9a9286..0000000 --- a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/TraceInformation.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * 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.accumulo.monitor.rest.api; - -public class TraceInformation { - - public int level; - public long time, start; - public String location, name; - public AddlInformation addlData; - - public TraceInformation() {} - - public TraceInformation(int level, long time, long start, String location, String name, AddlInformation addlData) { - this.level = level; - this.time = time; - this.start = start; - this.location = location; - this.name = name; - this.addlData = addlData; - } -} http://git-wip-us.apache.org/repos/asf/accumulo/blob/0ca5cd33/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/TraceList.java ---------------------------------------------------------------------- diff --git a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/TraceList.java b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/TraceList.java deleted file mode 100644 index a83841f..0000000 --- a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/TraceList.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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.accumulo.monitor.rest.api; - -import java.util.ArrayList; -import java.util.List; - -public class TraceList { - - public String id; - public Long start; - public List<TraceInformation> traces; - - public TraceList() { - traces = new ArrayList<>(); - } - - public TraceList(String id) { - this.id = id; - this.traces = new ArrayList<>(); - } - - public void addTrace(TraceInformation traces) { - this.traces.add(traces); - } - - public void addStartTime(Long start) { - this.start = start; - } -} http://git-wip-us.apache.org/repos/asf/accumulo/blob/0ca5cd33/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/TraceType.java ---------------------------------------------------------------------- diff --git a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/TraceType.java b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/TraceType.java deleted file mode 100644 index f0b5f3a..0000000 --- a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/TraceType.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * 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.accumulo.monitor.rest.api; - -import java.util.ArrayList; -import java.util.List; - -public class TraceType { - - public String traceType; - public List<TracesForTypeInformation> traces; - - public TraceType() { - traces = new ArrayList<>(); - } - - public TraceType(String type) { - this.traceType = type; - this.traces = new ArrayList<>(); - } - - public void addTrace(TracesForTypeInformation traces) { - this.traces.add(traces); - } -} http://git-wip-us.apache.org/repos/asf/accumulo/blob/0ca5cd33/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/TracesForTypeInformation.java ---------------------------------------------------------------------- diff --git a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/TracesForTypeInformation.java b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/TracesForTypeInformation.java deleted file mode 100644 index f23576f..0000000 --- a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/TracesForTypeInformation.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * 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.accumulo.monitor.rest.api; - -import org.apache.accumulo.tracer.thrift.RemoteSpan; - -public class TracesForTypeInformation { - - public String id, source; - public Long start, ms; - - public TracesForTypeInformation() {} - - public TracesForTypeInformation(RemoteSpan span) { - this.id = getIDFromSpan(span); - this.start = getDateFromSpan(span); - this.ms = getSpanTime(span); - this.source = getLocation(span); - } - - protected String getIDFromSpan(RemoteSpan span) { - if (span == null) - return null; - - return String.format("%s", Long.toHexString(span.traceId)); - } - - protected Long getDateFromSpan(RemoteSpan span) { - if (span == null) - return null; - - return span.start; - } - - protected Long getSpanTime(RemoteSpan span) { - if (span == null) - return null; - - return span.stop - span.start; - } - - protected String getLocation(RemoteSpan span) { - if (span == null) - return null; - - return span.svc + ":" + span.sender; - } - -} http://git-wip-us.apache.org/repos/asf/accumulo/blob/0ca5cd33/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/XMLInformation.java ---------------------------------------------------------------------- diff --git a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/XMLInformation.java b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/XMLInformation.java deleted file mode 100644 index 13ef410..0000000 --- a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/XMLInformation.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * 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.accumulo.monitor.rest.api; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlRootElement; - -@XmlRootElement(name = "stats") -public class XMLInformation { - - public List<TabletServer> servers; - - public String masterGoalState, masterState; - - public BadTabletServers badTabletServers; - public ServersShuttingDown tabletServersShuttingDown; - public Integer unassignedTablets; - public DeadServerList deadTabletServers; - - public DeadLoggerList deadLoggers; - - public TableInformationList tables; - - public Totals totals; - - public XMLInformation() { - servers = new ArrayList<>(); - } - - public XMLInformation(int size, MasterInformation info, TablesList tablesList) { - this.servers = new ArrayList<>(size); - - this.masterGoalState = info.masterGoalState; - this.masterState = info.masterState; - - this.badTabletServers = info.badTabletServers; - this.tabletServersShuttingDown = info.tabletServersShuttingDown; - this.unassignedTablets = info.unassignedTablets; - this.deadTabletServers = info.deadTabletServers; - this.deadLoggers = info.deadLoggers; - - getTableInformationList(tablesList.tables); - - this.totals = new Totals(info.ingestrate, info.queryrate, info.numentries); - } - - public void addTablet(TabletServer tablet) { - servers.add(tablet); - } - - /** - * For backwards compatibility, gets all the tables without namespace information - */ - private void getTableInformationList(List<TableNamespace> namespaces) { - - this.tables = new TableInformationList(); - - for (TableNamespace namespace : namespaces) { - for (TableInformation info : namespace.table) { - tables.addTable(info); - } - } - - } -} http://git-wip-us.apache.org/repos/asf/accumulo/blob/0ca5cd33/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/ZKInformation.java ---------------------------------------------------------------------- diff --git a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/ZKInformation.java b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/ZKInformation.java deleted file mode 100644 index c0f69b5..0000000 --- a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/ZKInformation.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * 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.accumulo.monitor.rest.api; - -import java.util.ArrayList; -import java.util.List; - -public class ZKInformation { - - public List<ZooKeeper> zkServers; - - public ZKInformation() { - zkServers = new ArrayList<>(); - } - - public void addZK(ZooKeeper server) { - zkServers.add(server); - } -} http://git-wip-us.apache.org/repos/asf/accumulo/blob/0ca5cd33/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/ZooKeeper.java ---------------------------------------------------------------------- diff --git a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/ZooKeeper.java b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/ZooKeeper.java deleted file mode 100644 index 6d0551d..0000000 --- a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/ZooKeeper.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * 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.accumulo.monitor.rest.api; - -public class ZooKeeper { - - public String server, mode; - public Integer clients; - - public ZooKeeper() {} - - public ZooKeeper(String server, String mode, Integer clients) { - this.server = server; - this.mode = mode; - this.clients = clients; - } -} http://git-wip-us.apache.org/repos/asf/accumulo/blob/0ca5cd33/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/bulkImport/BulkImport.java ---------------------------------------------------------------------- diff --git a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/bulkImport/BulkImport.java b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/bulkImport/BulkImport.java new file mode 100644 index 0000000..63c5dcd --- /dev/null +++ b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/bulkImport/BulkImport.java @@ -0,0 +1,61 @@ +/* + * 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.accumulo.monitor.rest.api.bulkImport; + +import java.util.ArrayList; +import java.util.List; + +/** + * BulkImport stores the bulk import and tserver bulk imports + * + * @since 2.0.0 + * + */ +public class BulkImport { + + // Variable names become JSON key + public List<BulkImportInformation> bulkImport; + public List<TabletServerBulkImportInformation> tabletServerBulkImport; + + /** + * Constructor to create the bulk import and tserver bulk import arrays + */ + public BulkImport() { + bulkImport = new ArrayList<>(); + tabletServerBulkImport = new ArrayList<>(); + } + + /** + * Adds a new bulk import to the array + * + * @param bulkImport + * new bulk import to add + */ + public void addBulkImport(BulkImportInformation bulkImport) { + this.bulkImport.add(bulkImport); + } + + /** + * Adds a new tserver bulk import to the array + * + * @param tabletServerBulkImport + * new tserver bulk import to add + */ + public void addTabletServerBulkImport(TabletServerBulkImportInformation tabletServerBulkImport) { + this.tabletServerBulkImport.add(tabletServerBulkImport); + } +} http://git-wip-us.apache.org/repos/asf/accumulo/blob/0ca5cd33/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/bulkImport/BulkImportInformation.java ---------------------------------------------------------------------- diff --git a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/bulkImport/BulkImportInformation.java b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/bulkImport/BulkImportInformation.java new file mode 100644 index 0000000..14566fc --- /dev/null +++ b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/bulkImport/BulkImportInformation.java @@ -0,0 +1,51 @@ +/* + * 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.accumulo.monitor.rest.api.bulkImport; + +import org.apache.accumulo.core.master.thrift.BulkImportState; + +/** + * Stores bulk import in a JSON object + * + * @since 2.0.0 + * + */ +public class BulkImportInformation { + + // Variable names become JSON key + public String filename; + public long age; + public BulkImportState state; + + public BulkImportInformation() {} + + /** + * Creates new bulk import object + * + * @param filename + * name of the bulk import file + * @param age + * age of the bulk import + * @param state + * state of the bulk import + */ + public BulkImportInformation(String filename, long age, BulkImportState state) { + this.filename = filename; + this.age = age; + this.state = state; + } +} http://git-wip-us.apache.org/repos/asf/accumulo/blob/0ca5cd33/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/bulkImport/BulkImportResource.java ---------------------------------------------------------------------- diff --git a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/bulkImport/BulkImportResource.java b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/bulkImport/BulkImportResource.java new file mode 100644 index 0000000..050e7f0 --- /dev/null +++ b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/bulkImport/BulkImportResource.java @@ -0,0 +1,72 @@ +/* + * 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.accumulo.monitor.rest.api.bulkImport; + +import java.util.List; + +import javax.ws.rs.GET; + +import org.apache.accumulo.core.master.thrift.BulkImportStatus; +import org.apache.accumulo.core.master.thrift.TabletServerStatus; +import org.apache.accumulo.monitor.Monitor; +import org.apache.accumulo.monitor.rest.api.BasicResource; + +/** + * The BulkImportResource is responsible for obtaining the information of the bulk import, and tablet server bulk import from the Monitor and creating the JSON + * objects with each + * + * @since 2.0.0 + * + */ +public class BulkImportResource extends BasicResource { + + /** + * Generates bulk import and tserver bulk imports with the information from the Monitor + * + * @return JSON object with BulkImport information + */ + @GET + public BulkImport getTables() { + + BulkImport bulkImport = new BulkImport(); + + // Generating Bulk Import and adding it to the return object + for (BulkImportStatus bulk : Monitor.getMmi().bulkImports) { + bulkImport.addBulkImport(new BulkImportInformation(bulk.filename, bulk.startTime, bulk.state)); + } + + // Generating TServer Bulk Import and adding it to the return object + for (TabletServerStatus tserverInfo : Monitor.getMmi().getTServerInfo()) { + int size = 0; + long oldest = 0L; + + List<BulkImportStatus> stats = tserverInfo.bulkImports; + if (stats != null) { + size = stats.size(); + oldest = Long.MAX_VALUE; + for (BulkImportStatus bulk : stats) { + oldest = Math.min(oldest, bulk.startTime); + } + if (oldest == Long.MAX_VALUE) { + oldest = 0L; + } + } + bulkImport.addTabletServerBulkImport(new TabletServerBulkImportInformation(tserverInfo, size, oldest)); + } + return bulkImport; + } +} http://git-wip-us.apache.org/repos/asf/accumulo/blob/0ca5cd33/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/bulkImport/TabletServerBulkImportInformation.java ---------------------------------------------------------------------- diff --git a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/bulkImport/TabletServerBulkImportInformation.java b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/bulkImport/TabletServerBulkImportInformation.java new file mode 100644 index 0000000..3b378f0 --- /dev/null +++ b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/bulkImport/TabletServerBulkImportInformation.java @@ -0,0 +1,52 @@ +/* + * 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.accumulo.monitor.rest.api.bulkImport; + +import org.apache.accumulo.core.master.thrift.TabletServerStatus; + +/** + * + * Stores tserver bulk import information + * + * @since 2.0.0 + * + */ +public class TabletServerBulkImportInformation { + + // Variable names become JSON key + public String server; + public int importSize; + public long oldestAge; + + public TabletServerBulkImportInformation() {} + + /** + * Creates a new tserver bulk import object + * + * @param server + * server name + * @param importSize + * import size + * @param oldestAge + * tserver bulk import age + */ + public TabletServerBulkImportInformation(TabletServerStatus server, int importSize, long oldestAge) { + this.server = server.getName(); + this.importSize = importSize; + this.oldestAge = oldestAge; + } +} http://git-wip-us.apache.org/repos/asf/accumulo/blob/0ca5cd33/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/garbageCollector/GarbageCollection.java ---------------------------------------------------------------------- diff --git a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/garbageCollector/GarbageCollection.java b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/garbageCollector/GarbageCollection.java new file mode 100644 index 0000000..6b067a3 --- /dev/null +++ b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/garbageCollector/GarbageCollection.java @@ -0,0 +1,63 @@ +/* + * 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.accumulo.monitor.rest.api.garbageCollector; + +import org.apache.accumulo.core.gc.thrift.GcCycleStats; + +/** + * + * GarbageCollection is responsible for creating the gc JSON object + * + * @since 2.0.0 + * + */ +public class GarbageCollection { + + public static final GarbageCollection EMPTY = new GarbageCollection(); + + // Variable names become JSON key + public GarbageCollectorCycle lastCycle = new GarbageCollectorCycle(); + public GarbageCollectorCycle currentCycle = new GarbageCollectorCycle(); + + public GarbageCollection() {} + + /** + * Creates a new Garbage Collector JSON object + * + * @param last + * last GC cycle + * @param current + * current GC cycle + */ + public GarbageCollection(GcCycleStats last, GcCycleStats current) { + this.lastCycle = new GarbageCollectorCycle(last); + this.currentCycle = new GarbageCollectorCycle(current); + } + + /** + * Creates a new Garbage Collector JSON object + * + * @param last + * last GC cycle + * @param current + * current GC cycle + */ + public GarbageCollection(GarbageCollectorCycle last, GarbageCollectorCycle current) { + this.lastCycle = last; + this.currentCycle = current; + } +} http://git-wip-us.apache.org/repos/asf/accumulo/blob/0ca5cd33/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/garbageCollector/GarbageCollectorCycle.java ---------------------------------------------------------------------- diff --git a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/garbageCollector/GarbageCollectorCycle.java b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/garbageCollector/GarbageCollectorCycle.java new file mode 100644 index 0000000..8d46670 --- /dev/null +++ b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/garbageCollector/GarbageCollectorCycle.java @@ -0,0 +1,53 @@ +/* + * 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.accumulo.monitor.rest.api.garbageCollector; + +import org.apache.accumulo.core.gc.thrift.GcCycleStats; + +/** + * + * Metrics about a single cycle of the garbage collector + * + * @since 2.0.0 + * + */ +public class GarbageCollectorCycle { + + public static final GarbageCollectorCycle EMPTY = new GarbageCollectorCycle(); + + // Variable names become JSON key + public long started, finished, candidates, inUse, deleted, errors; + + public GarbageCollectorCycle() { + started = finished = candidates = inUse = deleted = errors = 0l; + } + + /** + * Creates a new garbage collector cycle + * + * @param thriftStats + * used to find cycle information + */ + public GarbageCollectorCycle(GcCycleStats thriftStats) { + this.started = thriftStats.started; + this.finished = thriftStats.finished; + this.candidates = thriftStats.candidates; + this.inUse = thriftStats.inUse; + this.deleted = thriftStats.deleted; + this.errors = thriftStats.errors; + } +} http://git-wip-us.apache.org/repos/asf/accumulo/blob/0ca5cd33/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/garbageCollector/GarbageCollectorResource.java ---------------------------------------------------------------------- diff --git a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/garbageCollector/GarbageCollectorResource.java b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/garbageCollector/GarbageCollectorResource.java new file mode 100644 index 0000000..e3692af --- /dev/null +++ b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/garbageCollector/GarbageCollectorResource.java @@ -0,0 +1,134 @@ +/* + * 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.accumulo.monitor.rest.api.garbageCollector; + +import javax.ws.rs.GET; +import javax.ws.rs.Path; + +import org.apache.accumulo.core.gc.thrift.GCStatus; +import org.apache.accumulo.monitor.Monitor; +import org.apache.accumulo.monitor.rest.api.BasicResource; + +/** + * + * GarbageCollector metrics + * + * @since 2.0.0 + * + */ +public class GarbageCollectorResource extends BasicResource { + + /** + * Returns the garbage collector status + * + * @return garbage collector status + */ + @GET + public GarbageCollectorStatus getStatus() { + return new GarbageCollectorStatus(Monitor.getGcStatus()); + } + + /** + * Generates current and last file gc object + * + * @return file gc object + */ + @Path("/files") + @GET + public GarbageCollection getFileStatus() { + GCStatus gcStatus = Monitor.getGcStatus(); + if (null == gcStatus) { + return GarbageCollection.EMPTY; + } + return new GarbageCollection(gcStatus.last, gcStatus.current); + } + + /** + * Generates last file gc object + * + * @return last file gc object + */ + @Path("/files/last") + @GET + public GarbageCollectorCycle getLastCycle() { + GCStatus status = Monitor.getGcStatus(); + if (null == status) { + return GarbageCollectorCycle.EMPTY; + } + return new GarbageCollectorCycle(status.last); + } + + /** + * Generates current file gc object + * + * @return current file gc object + */ + @Path("/files/current") + @GET + public GarbageCollectorCycle getCurrentCycle() { + GCStatus status = Monitor.getGcStatus(); + if (null == status) { + return GarbageCollectorCycle.EMPTY; + } + return new GarbageCollectorCycle(status.current); + } + + /** + * Generates wal gc object + * + * @return wal gc object + */ + @Path("/wals") + @GET + public GarbageCollection getWalStatus() { + GCStatus gcStatus = Monitor.getGcStatus(); + if (null == gcStatus) { + return GarbageCollection.EMPTY; + } + return new GarbageCollection(gcStatus.lastLog, gcStatus.currentLog); + } + + /** + * Generates last wal object + * + * @return last wal object + */ + @Path("/wals/last") + @GET + public GarbageCollectorCycle getLastWalCycle() { + GCStatus status = Monitor.getGcStatus(); + if (null == status) { + return GarbageCollectorCycle.EMPTY; + } + return new GarbageCollectorCycle(status.lastLog); + } + + /** + * Generates current wal object + * + * @return current wal object + */ + @Path("/wals/current") + @GET + public GarbageCollectorCycle getCurrentWalCycle() { + GCStatus status = Monitor.getGcStatus(); + if (null == status) { + return GarbageCollectorCycle.EMPTY; + } + return new GarbageCollectorCycle(status.currentLog); + } +} http://git-wip-us.apache.org/repos/asf/accumulo/blob/0ca5cd33/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/garbageCollector/GarbageCollectorStatus.java ---------------------------------------------------------------------- diff --git a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/garbageCollector/GarbageCollectorStatus.java b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/garbageCollector/GarbageCollectorStatus.java new file mode 100644 index 0000000..d8b605a --- /dev/null +++ b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/garbageCollector/GarbageCollectorStatus.java @@ -0,0 +1,50 @@ +/* + * 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.accumulo.monitor.rest.api.garbageCollector; + +import org.apache.accumulo.core.gc.thrift.GCStatus; + +/** + * + * Responsible for grouping files and wals into a JSON object + * + * @since 2.0.0 + * + */ +public class GarbageCollectorStatus { + + public static final GarbageCollectorStatus EMPTY = new GarbageCollectorStatus(); + + // variable names become JSON key + public GarbageCollection files = new GarbageCollection(); + public GarbageCollection wals = new GarbageCollection(); + + public GarbageCollectorStatus() {} + + /** + * Groups gc status into files and wals + * + * @param status + * garbace collector status + */ + public GarbageCollectorStatus(GCStatus status) { + if (null != status) { + files = new GarbageCollection(status.last, status.current); + wals = new GarbageCollection(status.lastLog, status.currentLog); + } + } +} http://git-wip-us.apache.org/repos/asf/accumulo/blob/0ca5cd33/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/log/DeadLoggerInformation.java ---------------------------------------------------------------------- diff --git a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/log/DeadLoggerInformation.java b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/log/DeadLoggerInformation.java new file mode 100644 index 0000000..a6770d8 --- /dev/null +++ b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/log/DeadLoggerInformation.java @@ -0,0 +1,57 @@ +/* + * 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.accumulo.monitor.rest.api.log; + +import javax.xml.bind.annotation.XmlAttribute; + +/** + * + * Stores dead logger information + * + * @since 2.0.0 + * + */ +public class DeadLoggerInformation { + + // Variable names become JSON keys + @XmlAttribute + public String server; + + @XmlAttribute + public long lastStatus; + + @XmlAttribute + public String status; + + public DeadLoggerInformation() {} + + /** + * Stores a new dead logger information + * + * @param server + * dead logger location + * @param lastStatus + * previous status of the dead logger + * @param status + * status of the dead logger + */ + public DeadLoggerInformation(String server, long lastStatus, String status) { + this.server = server; + this.lastStatus = lastStatus; + this.status = status; + } +} http://git-wip-us.apache.org/repos/asf/accumulo/blob/0ca5cd33/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/log/DeadLoggerList.java ---------------------------------------------------------------------- diff --git a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/log/DeadLoggerList.java b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/log/DeadLoggerList.java new file mode 100644 index 0000000..0522c8a --- /dev/null +++ b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/log/DeadLoggerList.java @@ -0,0 +1,50 @@ +/* + * 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.accumulo.monitor.rest.api.log; + +import java.util.ArrayList; +import java.util.List; + +/** + * + * Stores a new dead logger object + * + * @since 2.0.0 + * + */ +public class DeadLoggerList { + + // Variable names become JSON keys + public List<DeadLoggerInformation> deadLogger; + + /** + * Creates the array list + */ + public DeadLoggerList() { + deadLogger = new ArrayList<>(); + } + + /** + * Adds a new dead logger to the list + * + * @param deadLogger + * dead logger to add + */ + public void addDeadLogger(DeadLoggerInformation deadLogger) { + this.deadLogger.add(deadLogger); + } +} http://git-wip-us.apache.org/repos/asf/accumulo/blob/0ca5cd33/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/log/LogEvent.java ---------------------------------------------------------------------- diff --git a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/log/LogEvent.java b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/log/LogEvent.java new file mode 100644 index 0000000..28e9710 --- /dev/null +++ b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/log/LogEvent.java @@ -0,0 +1,57 @@ +/* + * 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.accumulo.monitor.rest.api.log; + +/** + * + * A single message logged + * + * @since 2.0.0 + * + */ +public class LogEvent { + + // Variable names become JSON keys + public long timestamp; + public Object application; + public int count; + public String level, message; + + public LogEvent() {} + + /** + * Stores a new log event + * + * @param timestamp + * log event timestamp + * @param application + * log event application + * @param count + * log event count + * @param level + * log event level + * @param message + * log event message + */ + public LogEvent(long timestamp, Object application, int count, String level, String message) { + this.timestamp = timestamp; + this.application = application; + this.count = count; + this.level = level; + this.message = message; + } +} http://git-wip-us.apache.org/repos/asf/accumulo/blob/0ca5cd33/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/log/LogResource.java ---------------------------------------------------------------------- diff --git a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/log/LogResource.java b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/log/LogResource.java new file mode 100644 index 0000000..4401807 --- /dev/null +++ b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/log/LogResource.java @@ -0,0 +1,75 @@ +/* + * 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.accumulo.monitor.rest.api.log; + +import java.util.ArrayList; +import java.util.List; + +import javax.ws.rs.GET; +import javax.ws.rs.POST; + +import org.apache.accumulo.monitor.rest.api.BasicResource; +import org.apache.accumulo.server.monitor.DedupedLogEvent; +import org.apache.accumulo.server.monitor.LogService; +import org.apache.log4j.spi.LoggingEvent; + +/** + * + * Responsible for generating a new log JSON object + * + * @since 2.0.0 + * + */ +public class LogResource extends BasicResource { + + /** + * Generates log event list as a JSON object + * + * @return log event array + */ + @GET + public List<LogEvent> getRecentLogs() { + List<DedupedLogEvent> dedupedLogEvents = LogService.getInstance().getEvents(); + ArrayList<LogEvent> logEvents = new ArrayList<>(dedupedLogEvents.size()); + + final StringBuilder msg = new StringBuilder(64); + for (DedupedLogEvent dev : dedupedLogEvents) { + msg.setLength(0); + final LoggingEvent ev = dev.getEvent(); + Object application = ev.getMDC("application"); + if (application == null) + application = ""; + + msg.append(ev.getMessage().toString()); + if (ev.getThrowableStrRep() != null) + for (String line : ev.getThrowableStrRep()) + msg.append("\n\t").append(line); + + // Add a new log event to the list + logEvents.add(new LogEvent(ev.getTimeStamp(), application, dev.getCount(), ev.getLevel().toString(), msg.toString().trim())); + } + return logEvents; + } + + /** + * REST call to clear the logs + */ + @POST + public void clearLogs() { + LogService.getInstance().clear(); + } +} http://git-wip-us.apache.org/repos/asf/accumulo/blob/0ca5cd33/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/master/MasterInformation.java ---------------------------------------------------------------------- diff --git a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/master/MasterInformation.java b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/master/MasterInformation.java new file mode 100644 index 0000000..b941b4f --- /dev/null +++ b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/master/MasterInformation.java @@ -0,0 +1,150 @@ +/* + * 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.accumulo.monitor.rest.api.master; + +import org.apache.accumulo.monitor.rest.api.log.DeadLoggerList; +import org.apache.accumulo.monitor.rest.api.tserver.BadTabletServers; +import org.apache.accumulo.monitor.rest.api.tserver.DeadServerList; +import org.apache.accumulo.monitor.rest.api.tserver.ServersShuttingDown; + +/** + * + * Responsible for storing master information as a JSON object + * + * @since 2.0.0 + * + */ +public class MasterInformation { + + // Variable names become JSON keys + public String master, lastGC, gcStatus, masterGoalState, masterState; + + public Integer onlineTabletServers, totalTabletServers, tablets, unassignedTablets; + public long numentries; + public double osload, ingestrate, entriesRead, queryrate; // entriesReturned same as queryrate + public long holdTime; + + public int tables, deadTabletServersCount; + public long lookups, uptime; + + public BadTabletServers badTabletServers; + public ServersShuttingDown tabletServersShuttingDown; + public DeadServerList deadTabletServers; + public DeadLoggerList deadLoggers; + + /** + * Creates an empty master JSON object + */ + public MasterInformation() { + this.master = "No Masters running"; + this.onlineTabletServers = 0; + this.totalTabletServers = 0; + this.lastGC = "0"; + this.tablets = 0; + this.unassignedTablets = 0; + this.numentries = 0l; + this.ingestrate = 0d; + this.entriesRead = 0d; + this.queryrate = 0d; + this.holdTime = 0; + this.osload = 0l; + } + + public MasterInformation(String master) { + this.master = master; + } + + /** + * Stores a new master JSON object + * + * @param master + * Master location + * @param onlineTabletServers + * Number of online tservers + * @param totalTabletServers + * Total number of tservers + * @param lastGC + * Time of the last gc + * @param tablets + * Number of tablet + * @param unassignedTablets + * Number of unassigned tablets + * @param entries + * Number of entries + * @param ingest + * Number of ingest + * @param entriesRead + * Number of queries + * @param entriesReturned + * Number of returned queries + * @param holdTime + * Amount of hold time + * @param osLoad + * Amount of load to the OS + * @param tables + * Number of tables + * @param deadTabletServersCount + * Number of dead tservers + * @param lookups + * Number of lookups + * @param uptime + * Time the Monitor has been running + * @param gcStatus + * Status of the garbage collector + * @param masterGoalState + * Goal state of the master + * @param masterState + * Current state of the master + * @param badTabletServers + * Number of bad tservers + * @param tabletServersShuttingDown + * Number of tservers shutting down + * @param deadTabletServers + * Number of dead tservers + * @param deadLoggers + * Number of dead loggers + */ + public MasterInformation(String master, int onlineTabletServers, int totalTabletServers, String lastGC, int tablets, int unassignedTablets, long entries, + double ingest, double entriesRead, double entriesReturned, long holdTime, double osLoad, int tables, int deadTabletServersCount, long lookups, + long uptime, String gcStatus, String masterGoalState, String masterState, BadTabletServers badTabletServers, + ServersShuttingDown tabletServersShuttingDown, DeadServerList deadTabletServers, DeadLoggerList deadLoggers) { + + this.master = master; + this.onlineTabletServers = onlineTabletServers; + this.totalTabletServers = totalTabletServers; + this.lastGC = lastGC; + this.tablets = tablets; + this.unassignedTablets = unassignedTablets; + this.numentries = entries; + this.ingestrate = ingest; + this.entriesRead = entriesRead; + this.queryrate = entriesReturned; + this.holdTime = holdTime; + this.osload = osLoad; + this.tables = tables; + this.deadTabletServersCount = deadTabletServersCount; + this.lookups = lookups; + this.uptime = uptime; + this.gcStatus = gcStatus; + this.masterGoalState = masterGoalState; + this.masterState = masterState; + this.badTabletServers = badTabletServers; + this.tabletServersShuttingDown = tabletServersShuttingDown; + this.deadTabletServers = deadTabletServers; + this.deadLoggers = deadLoggers; + } +}
