提交 f0d87c2f 编写于 作者: Y yong.you

fix the frequent function url build error

上级 f6a82d67
......@@ -60,7 +60,7 @@ public class CrossAnalyzer extends AbstractMessageAnalyzer<CrossReport> implemen
}
public CrossInfo parseCorssTransaction(Transaction t, MessageTree tree) {
if (m_serverConfigManager.shouldDiscard(t)) {
if (m_serverConfigManager.discardTransaction(t)) {
return null;
} else {
String type = t.getType();
......
......@@ -169,7 +169,7 @@ public class DependencyAnalyzer extends AbstractMessageAnalyzer<DependencyReport
}
private void processTransaction(DependencyReport report, MessageTree tree, Transaction t) {
if (m_serverConfigManager.shouldDiscard(t)) {
if (m_serverConfigManager.discardTransaction(t)) {
return;
} else {
processTransactionType(report, t);
......
......@@ -65,7 +65,7 @@ public class MatrixAnalyzer extends AbstractMessageAnalyzer<MatrixReport> implem
if (message instanceof Transaction) {
String messageType = message.getType();
if (m_serverConfigManager.shouldDiscard((Transaction) message)) {
if (m_serverConfigManager.discardTransaction((Transaction) message)) {
return;
}
if (messageType.equals("URL") || messageType.equals("Service") || messageType.equals("PigeonService")) {
......
......@@ -142,7 +142,7 @@ public class TransactionAnalyzer extends AbstractMessageAnalyzer<TransactionRepo
}
protected void processTransaction(TransactionReport report, MessageTree tree, Transaction t) {
if (m_serverConfigManager.shouldDiscard(t)) {
if (m_serverConfigManager.discardTransaction(t)) {
return;
} else {
String ip = tree.getIpAddress();
......
......@@ -51,22 +51,6 @@ public class ServerConfigManager implements Initializable, LogEnabled {
return 2280;
}
public boolean isHdfsOn() {
return !m_config.getStorage().isHdfsDisabled();
}
public boolean isSerialWrite() {
return false;
}
public boolean isClientCall(String type){
return "PigeonCall".equals(type) || "Call".equals(type);
}
public boolean isServerService(String type){
return "PigeonService".equals(type) || "Service".equals(type);
}
public String getConsoleDefaultDomain() {
if (m_config != null) {
return m_config.getConsole().getDefaultDomain();
......@@ -75,19 +59,6 @@ public class ServerConfigManager implements Initializable, LogEnabled {
}
}
public String getConsoleRemoteServers() {
if (m_config != null) {
ConsoleConfig console = m_config.getConsole();
String remoteServers = console.getRemoteServers();
if (remoteServers != null && remoteServers.length() > 0) {
return remoteServers;
}
}
return "";
}
public List<Pair<String, Integer>> getConsoleEndpoints() {
if (m_config != null) {
ConsoleConfig console = m_config.getConsole();
......@@ -109,6 +80,27 @@ public class ServerConfigManager implements Initializable, LogEnabled {
}
}
public String getConsoleRemoteServers() {
if (m_config != null) {
ConsoleConfig console = m_config.getConsole();
String remoteServers = console.getRemoteServers();
if (remoteServers != null && remoteServers.length() > 0) {
return remoteServers;
}
}
return "";
}
public String getEmailAccount() {
return "book.robot.dianping@gmail.com";
}
public String getEmailPassword() {
return "xudgtsnoxivwclna";
}
public String getHdfsBaseDir(String id) {
if (m_config != null) {
HdfsConfig hdfsConfig = m_config.getStorage().findHdfs(id);
......@@ -178,6 +170,10 @@ public class ServerConfigManager implements Initializable, LogEnabled {
return null;
}
public String getHttpSmsApi() {
return "";
}
public Map<String, Domain> getLongConfigDomains() {
if (m_config != null) {
LongConfig longConfig = m_config.getConsumer().getLongConfig();
......@@ -228,6 +224,15 @@ public class ServerConfigManager implements Initializable, LogEnabled {
}
}
@Override
public void initialize() throws InitializationException {
m_unusedTypes.add("Service");
m_unusedTypes.add("PigeonService");
m_unusedNames.add("piegonService:heartTaskService:heartBeat");
m_unusedNames.add("piegonService:heartTaskService:heartBeat()");
m_unusedNames.add("pigeon:HeartBeatService:null");
}
public void initialize(File configFile) throws Exception {
if (configFile != null && configFile.canRead()) {
m_logger.info(String.format("Loading configuration file(%s) ...", configFile.getCanonicalPath()));
......@@ -256,10 +261,26 @@ public class ServerConfigManager implements Initializable, LogEnabled {
}
public boolean isClientCall(String type) {
return "PigeonCall".equals(type) || "Call".equals(type);
}
public boolean isHdfsOn() {
return !m_config.getStorage().isHdfsDisabled();
}
public boolean isInitialized() {
return m_config != null;
}
public boolean isJobMachine() {
if (m_config != null) {
return m_config.isJobMachine();
} else {
return true;
}
}
public boolean isLocalMode() {
if (m_config != null) {
return m_config.isLocalMode();
......@@ -268,12 +289,39 @@ public class ServerConfigManager implements Initializable, LogEnabled {
}
}
public boolean isJobMachine() {
if (m_config != null) {
return m_config.isJobMachine();
public boolean isOfflineServer(String ip) {
if (ip != null && ip.startsWith("192.")) {
return true;
} else {
return false;
}
}
public boolean isOnlineServer(String ip) {
if (ip != null && ip.startsWith("10.")) {
return true;
} else {
return false;
}
}
public boolean isSerialWrite() {
return false;
}
public boolean isServerService(String type) {
return "PigeonService".equals(type) || "Service".equals(type);
}
public boolean discardTransaction(Transaction t) {
// pigeon default heartbeat is no use
String type = t.getType();
String name = t.getName();
if (m_unusedTypes.contains(type) && m_unusedNames.contains(name)) {
return true;
}
return false;
}
private long toLong(String str, long defaultValue) {
......@@ -303,52 +351,4 @@ public class ServerConfigManager implements Initializable, LogEnabled {
return !domain.equals("PhoenixAgent") && !domain.equals(Constants.FRONT_END);
}
public boolean shouldDiscard(Transaction t) {
// pigeon default heartbeat is no use
String type = t.getType();
String name = t.getName();
if (m_unusedTypes.contains(type) && m_unusedNames.contains(name)) {
return true;
}
return false;
}
public boolean isOnlineServer(String ip) {
if (ip != null && ip.startsWith("10.")) {
return true;
} else {
return false;
}
}
public boolean isOfflineServer(String ip) {
if (ip != null && ip.startsWith("192.")) {
return true;
} else {
return false;
}
}
@Override
public void initialize() throws InitializationException {
m_unusedTypes.add("Service");
m_unusedTypes.add("PigeonService");
m_unusedNames.add("piegonService:heartTaskService:heartBeat");
m_unusedNames.add("piegonService:heartTaskService:heartBeat()");
m_unusedNames.add("pigeon:HeartBeatService:null");
}
public String getEmailAccount(){
return "book.robot.dianping@gmail.com";
}
public String getEmailPassword(){
return "xudgtsnoxivwclna";
}
public String getHttpSmsApi(){
return "";
}
}
......@@ -58,10 +58,6 @@ public class DefaultBucketManager extends ContainerHolder implements BucketManag
String path;
Date date = new Date(timestamp);
// if (type == MessageTree.class) {
// path = m_pathBuilder.getMessagePath(name, date);
// } else {
// }
path = m_pathBuilder.getReportPath(name, date);
Entry entry = new Entry(type, path, namespace);
......@@ -86,7 +82,7 @@ public class DefaultBucketManager extends ContainerHolder implements BucketManag
return getBucket(String.class, timestamp, name, "report");
}
static class Entry {
public static class Entry {
private String m_namespace;
private String m_path;
......
......@@ -58,7 +58,7 @@
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"
aria-hidden="true">×</button>
<h4 id="myModalLabel" class="text-success">用户登录</h4>
<h4 id="myModalLabel" class="text-success text-center">用户登录</h4>
</div>
<div class="control-group">
<label class="control-label text-success" for="account">用户名</label>
......@@ -111,11 +111,6 @@
$('#frequent').html("常用");
}
}
function buildHref(domain){
var href = '<a href="?op=history&domain='+domain+'&date=${model.date}">&nbsp;[&nbsp;'+domain+'&nbsp;]&nbsp;</a>';
return href;
}
$(document).ready(function() {
var domains= getcookie('CAT_DOMAINS');
var domainArray =domains.split("|");
......
......@@ -9,6 +9,12 @@
<%@ attribute name="subtitle" fragment="true"%>
<a:body>
<script>
function buildHref(domain){
var href = '<a href="?op=history&domain='+domain+'&date=${model.date}">&nbsp;[&nbsp;'+domain+'&nbsp;]&nbsp;</a>';
return href;
}
</script>
<div class="report">
<table class="header">
<tr>
......
......@@ -9,6 +9,13 @@
<%@ attribute name="subtitle" fragment="true"%>
<a:body>
<script>
function buildHref(domain){
var href = '<a href="?domain='+domain+'&date=${model.date}">&nbsp;[&nbsp;'+domain+'&nbsp;]&nbsp;</a>';
return href;
}
</script>
<div class="report">
<table class="header">
<tr>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册