Source:
<code>private void checkDRRole() { SyncCallback cb = new SyncCallback(); if (getConnectionHadler().callProcedure(getInternalUser(), false, BatchTimeoutOverrideType.NO_TIMEOUT, cb, "@Statistics", "DRROLE",0)) { try { cb.waitForResponse(); } catch (InterruptedException e) { m_logger.error("Interrupted while retrieving cluster for DRROLE STATS", e); return; } <START> ClientResponseImpl r = ClientResponseImpl.class.cast(cb.getResponse()); <END> if (r.getStatus() != ClientResponse.SUCCESS) { m_logger.error("Unable to retrieve DRROLE STATS: " + r.getStatusString()); return; } VoltTable result = r.getResults()[0]; while (result.advanceRow()) { DrRoleType drRole = DrRoleType.fromValue(result.getString(DRRoleStats.CN_ROLE).toLowerCase()); DRRoleStats.State state = DRRoleStats.State.valueOf(result.getString(DRRoleStats.CN_STATE)); byte remoteCluster = (byte) result.getLong(DRRoleStats.CN_REMOTE_CLUSTER_ID); if (m_logger.isDebugEnabled()) { m_logger.debug("DRROLE stats: Role:" + drRole + " State:" + state + " Remote Cluster ID:" + remoteCluster); } if (drRole == DrRoleType.NONE) { continue; } if (DRRoleStats.State.STOPPED == state) { if (!m_snmpDRTrapSent.getOrDefault(remoteCluster, false)) { m_snmpTrapSender.statistics(FaultFacility.DR, String.format("Database Replication ROLE: %s break with Remote Cluster %d.", drRole, remoteCluster)); m_snmpDRTrapSent.put(remoteCluster, true); } } else { if (m_snmpDRTrapSent.getOrDefault(remoteCluster, false)) { m_snmpDRTrapSent.put(remoteCluster, false); } } } } else { m_logger.error("Unable to retrieve DRROLE STATS:: failed to invoke @Statistics DRROLE, 0."); } }</code><technical_language>purpose of cast</technical_language>

Target:
private void checkDRRole() { SyncCallback cb = new SyncCallback(); if (getConnectionHadler().callProcedure(getInternalUser(), false, BatchTimeoutOverrideType.NO_TIMEOUT, cb, "@Statistics", "DRROLE",0)) { try { cb.waitForResponse(); } catch (InterruptedException e) { m_logger.error("Interrupted while retrieving cluster for DRROLE STATS", e); return; } ClientResponse r = cb.getResponse(); if (r.getStatus() != ClientResponse.SUCCESS) { m_logger.error("Unable to retrieve DRROLE STATS: " + r.getStatusString()); return; } VoltTable result = r.getResults()[0]; while (result.advanceRow()) { DrRoleType drRole = DrRoleType.fromValue(result.getString(DRRoleStats.CN_ROLE).toLowerCase()); DRRoleStats.State state = DRRoleStats.State.valueOf(result.getString(DRRoleStats.CN_STATE)); byte remoteCluster = (byte) result.getLong(DRRoleStats.CN_REMOTE_CLUSTER_ID); if (m_logger.isDebugEnabled()) { m_logger.debug("DRROLE stats: Role:" + drRole + " State:" + state + " Remote Cluster ID:" + remoteCluster); } if (drRole == DrRoleType.NONE) { continue; } if (DRRoleStats.State.STOPPED == state) { if (!m_snmpDRTrapSent.getOrDefault(remoteCluster, false)) { m_snmpTrapSender.statistics(FaultFacility.DR, String.format("Database Replication ROLE: %s break with Remote Cluster %d.", drRole, remoteCluster)); m_snmpDRTrapSent.put(remoteCluster, true); } } else { if (m_snmpDRTrapSent.getOrDefault(remoteCluster, false)) { m_snmpDRTrapSent.put(remoteCluster, false); } } } } else { m_logger.error("Unable to retrieve DRROLE STATS:: failed to invoke @Statistics DRROLE, 0."); } }