public ObjectName[] listGatewaySenderObjectNames(String member) throws Exception { validateMember(member); DistributedMember distributedMember = BeanUtilFuncs .getDistributedMemberByNameOrId(member); List<ObjectName> listName = null; ObjectName pattern = new ObjectName( ManagementConstants.GATEWAY_SENDER_PATTERN); Set<ObjectName> mbeanSet = service.queryMBeanNames(distributedMember); if (mbeanSet != null && mbeanSet.size() > 0) { listName = new ArrayList<ObjectName>(); for (ObjectName name : mbeanSet) { if (pattern.apply(name)) { listName.add(name); } } } if (listName != null && listName.size() > 0) { ObjectName[] arry = new ObjectName[listName.size()]; return listName.toArray(arry); } return ManagementConstants.NO_DATA_OBJECTNAME; }
private void intitGemfireProperties() { if (gemFirePropertyData == null) { this.gemFirePropertyData = BeanUtilFuncs.initGemfireProperties(config); } }
/** * * @param sc * @return tail of log * @throws IOException */ public static String tailSystemLog(DistributionConfig sc, final int numLines) throws IOException { File logFile = sc.getLogFile(); if (logFile == null || logFile.equals(new File(""))) { return null; } if (!logFile.isAbsolute()) { logFile = new File(logFile.getAbsolutePath()); } return tailSystemLog(logFile, numLines); }
return result.compressedBytes; } else { return BeanUtilFuncs.decompress(result.compressedBytes); decompressedStr = BeanUtilFuncs.decompress(it.next().compressedBytes); decompressedList.add(decompressedStr); return BeanUtilFuncs.compress(wrapResult(decompressedList.toString())); } else { return wrapResult(decompressedList.toString());
public void run() { SystemManagementService service = (SystemManagementService) getManagementService(); DistributedSystemMXBean bean = service.getDistributedSystemMXBean(); assertNotNull(bean); try { String jsonString1 = null; byte[] bytes = bean.queryDataForCompressedResult(queriesForRR[2], null, 2); jsonString1 = BeanUtilFuncs.decompress(bytes); if (jsonString1.contains("result") && !jsonString1.contains("No Data Found")) { GfJsonObject gfJsonObj = new GfJsonObject(jsonString1); getLogWriter().info("testLimit" + queriesForRR[2] + " is = " + jsonString1); GfJsonArray arr = gfJsonObj.getJSONArray("result"); assertEquals(2, arr.size()); } else { fail("Query On Cluster should have result"); } } catch (GfJsonException e) { fail(e.getMessage()); } catch (IOException e) { fail(e.getMessage()); } catch (Exception e) { fail(e.getMessage()); } } });
decompressedList.add(BeanUtilFuncs.decompress(result.compressedBytes)); return wrapResult(decompressedList.toString()); return BeanUtilFuncs.decompress(result.compressedBytes); decompressedStr = BeanUtilFuncs.decompress(it.next().compressedBytes); decompressedList.add(decompressedStr); return BeanUtilFuncs.compress(wrapResult(decompressedList.toString())); } else { return wrapResult(decompressedList.toString());
public void run() { Cache cache = getCache(); SystemManagementService service = (SystemManagementService) getManagementService(); DistributedSystemMXBean bean = service.getDistributedSystemMXBean(); assertNotNull(bean); try { byte[] bytes = bean.queryDataForCompressedResult(queriesForRR[0], member1.getId() + "," + member2.getId(), 2); String jsonString = BeanUtilFuncs.decompress(bytes); GfJsonObject gfJsonObj = new GfJsonObject(jsonString); getLogWriter().info("testMemberWise " + queriesForRR[2] + " is = " + jsonString); } catch (GfJsonException e) { fail(e.getMessage()); } catch (IOException e) { fail(e.getMessage()); } catch (Exception e) { fail(e.getMessage()); } } });
result.add(RESULT_KEY, NO_DATA_FOUND); return new QueryDataFunctionResult(QUERY_EXEC_SUCCESS, BeanUtilFuncs.compress(result.toString())); } catch (Exception e) { logger.warning(e);
/** * * @param sc * @return tail of log * @throws IOException */ public static String tailSystemLog(DistributionConfig sc, final int numLines) throws IOException { File logFile = sc.getLogFile(); if (logFile == null || logFile.equals(new File(""))) { return null; } if (!logFile.isAbsolute()) { logFile = new File(logFile.getAbsolutePath()); } return tailSystemLog(logFile, numLines); }
public ObjectName[] listGatewaySenderObjectNames(String member) throws Exception { validateMember(member); DistributedMember distributedMember = BeanUtilFuncs .getDistributedMemberByNameOrId(member); List<ObjectName> listName = null; ObjectName pattern = new ObjectName( ManagementConstants.GATEWAY_SENDER_PATTERN); Set<ObjectName> mbeanSet = service.queryMBeanNames(distributedMember); if (mbeanSet != null && mbeanSet.size() > 0) { listName = new ArrayList<ObjectName>(); for (ObjectName name : mbeanSet) { if (pattern.apply(name)) { listName.add(name); } } } if (listName != null && listName.size() > 0) { ObjectName[] arry = new ObjectName[listName.size()]; return listName.toArray(arry); } return ManagementConstants.NO_DATA_OBJECTNAME; }
private void initGemfireProperties() { if (gemFirePropertyData == null) { this.gemFirePropertyData = BeanUtilFuncs.initGemfireProperties(config); } }
try { InternalDistributedSystem sys = system; mainTail = BeanUtilFuncs.tailSystemLog(logFile, numLines); if (mainTail == null) { mainTail = ManagementStrings.TailLogResponse_NO_LOG_FILE_WAS_SPECIFIED_IN_THE_CONFIGURATION_MESSAGES_IS_BEING_DIRECTED_TO_STDOUT
while (st.hasMoreTokens()) { String member = st.nextToken(); DistributedMember distributedMember = BeanUtilFuncs.getDistributedMemberByNameOrId(member); inputMembers.add(distributedMember); if (distributedMember == null) {
try { InternalDistributedSystem sys = system; mainTail = BeanUtilFuncs.tailSystemLog(logFile, numLines); if (mainTail == null) { mainTail = ManagementStrings.TailLogResponse_NO_LOG_FILE_WAS_SPECIFIED_IN_THE_CONFIGURATION_MESSAGES_IS_BEING_DIRECTED_TO_STDOUT
while (st.hasMoreTokens()) { String member = st.nextToken(); DistributedMember distributedMember = BeanUtilFuncs.getDistributedMemberByNameOrId(member); inputMembers.add(distributedMember); if (distributedMember == null) {
childTail = BeanUtilFuncs.tailSystemLog(lwa.getChildLogFile(),numLines); mainTail = BeanUtilFuncs.tailSystemLog(sys.getConfig(), numLines); if (mainTail == null) { mainTail = LocalizedStrings.TailLogResponse_NO_LOG_FILE_WAS_SPECIFIED_IN_THE_CONFIGURATION_MESSAGES_WILL_BE_DIRECTED_TO_STDOUT
childTail = BeanUtilFuncs.tailSystemLog(mlw.getChildLogFile(),numLines); mainTail = BeanUtilFuncs.tailSystemLog(sys.getConfig(), numLines); if (mainTail == null) { mainTail = LocalizedStrings.TailLogResponse_NO_LOG_FILE_WAS_SPECIFIED_IN_THE_CONFIGURATION_MESSAGES_WILL_BE_DIRECTED_TO_STDOUT