Search in sources :

Example 1 with ServerTask

use of org.apache.hadoop.hbase.ServerTask in project hbase by apache.

the class TestRegionsRecoveryChore method getClusterMetrics.

private static ClusterMetrics getClusterMetrics(int noOfLiveServer) {
    ClusterMetrics clusterMetrics = new ClusterMetrics() {

        @Nullable
        @Override
        public String getHBaseVersion() {
            return null;
        }

        @Override
        public List<ServerName> getDeadServerNames() {
            return null;
        }

        @Override
        public Map<ServerName, ServerMetrics> getLiveServerMetrics() {
            Map<ServerName, ServerMetrics> liveServerMetrics = new HashMap<>();
            for (int i = 0; i < noOfLiveServer; i++) {
                ServerName serverName = ServerName.valueOf("rs_" + i, 16010, 12345);
                liveServerMetrics.put(serverName, TestRegionsRecoveryChore.getServerMetrics(i + 3));
            }
            return liveServerMetrics;
        }

        @Nullable
        @Override
        public ServerName getMasterName() {
            return null;
        }

        @Override
        public List<ServerName> getBackupMasterNames() {
            return null;
        }

        @Override
        public List<RegionState> getRegionStatesInTransition() {
            return null;
        }

        @Nullable
        @Override
        public String getClusterId() {
            return null;
        }

        @Override
        public List<String> getMasterCoprocessorNames() {
            return null;
        }

        @Nullable
        @Override
        public Boolean getBalancerOn() {
            return null;
        }

        @Override
        public int getMasterInfoPort() {
            return 0;
        }

        @Override
        public List<ServerName> getServersName() {
            return null;
        }

        @Override
        public Map<TableName, RegionStatesCount> getTableRegionStatesCount() {
            return null;
        }

        @Override
        public List<ServerTask> getMasterTasks() {
            return null;
        }
    };
    return clusterMetrics;
}
Also used : TableName(org.apache.hadoop.hbase.TableName) ClusterMetrics(org.apache.hadoop.hbase.ClusterMetrics) ServerTask(org.apache.hadoop.hbase.ServerTask) HashMap(java.util.HashMap) ServerName(org.apache.hadoop.hbase.ServerName) ServerMetrics(org.apache.hadoop.hbase.ServerMetrics) RegionStatesCount(org.apache.hadoop.hbase.client.RegionStatesCount)

Example 2 with ServerTask

use of org.apache.hadoop.hbase.ServerTask in project hbase by apache.

the class TestRegionsRecoveryChore method getServerMetrics.

private static ServerMetrics getServerMetrics(int noOfRegions) {
    ServerMetrics serverMetrics = new ServerMetrics() {

        @Override
        public ServerName getServerName() {
            return null;
        }

        @Override
        public long getRequestCountPerSecond() {
            return 0;
        }

        @Override
        public long getRequestCount() {
            return 0;
        }

        @Override
        public long getReadRequestsCount() {
            return 0;
        }

        @Override
        public long getWriteRequestsCount() {
            return 0;
        }

        @Override
        public Size getUsedHeapSize() {
            return null;
        }

        @Override
        public Size getMaxHeapSize() {
            return null;
        }

        @Override
        public int getInfoServerPort() {
            return 0;
        }

        @Override
        public List<ReplicationLoadSource> getReplicationLoadSourceList() {
            return null;
        }

        @Override
        public Map<String, List<ReplicationLoadSource>> getReplicationLoadSourceMap() {
            return null;
        }

        @Nullable
        @Override
        public ReplicationLoadSink getReplicationLoadSink() {
            return null;
        }

        @Override
        public Map<byte[], RegionMetrics> getRegionMetrics() {
            Map<byte[], RegionMetrics> regionMetricsMap = new HashMap<>();
            for (int i = 0; i < noOfRegions; i++) {
                byte[] regionName = Bytes.toBytes("region" + regionNo + "_" + i);
                regionMetricsMap.put(regionName, TestRegionsRecoveryChore.getRegionMetrics(regionName, 100 * i));
                ++regionNo;
            }
            return regionMetricsMap;
        }

        @Override
        public Map<byte[], UserMetrics> getUserMetrics() {
            return new HashMap<>();
        }

        @Override
        public Set<String> getCoprocessorNames() {
            return null;
        }

        @Override
        public long getReportTimestamp() {
            return 0;
        }

        @Override
        public long getLastReportTimestamp() {
            return 0;
        }

        @Override
        public List<ServerTask> getTasks() {
            return null;
        }
    };
    return serverMetrics;
}
Also used : ReplicationLoadSource(org.apache.hadoop.hbase.replication.ReplicationLoadSource) ServerTask(org.apache.hadoop.hbase.ServerTask) HashMap(java.util.HashMap) ServerMetrics(org.apache.hadoop.hbase.ServerMetrics) List(java.util.List) UserMetrics(org.apache.hadoop.hbase.UserMetrics) RegionMetrics(org.apache.hadoop.hbase.RegionMetrics)

Aggregations

HashMap (java.util.HashMap)2 ServerMetrics (org.apache.hadoop.hbase.ServerMetrics)2 ServerTask (org.apache.hadoop.hbase.ServerTask)2 List (java.util.List)1 ClusterMetrics (org.apache.hadoop.hbase.ClusterMetrics)1 RegionMetrics (org.apache.hadoop.hbase.RegionMetrics)1 ServerName (org.apache.hadoop.hbase.ServerName)1 TableName (org.apache.hadoop.hbase.TableName)1 UserMetrics (org.apache.hadoop.hbase.UserMetrics)1 RegionStatesCount (org.apache.hadoop.hbase.client.RegionStatesCount)1 ReplicationLoadSource (org.apache.hadoop.hbase.replication.ReplicationLoadSource)1