Source:
<code>private void scanTruncationSnapshots() { if (m_truncationSnapshotPath == null) { try { m_truncationSnapshotPath = new String(m_zk.getData(VoltZK.test_scan_path, false, null), "UTF-8"); } catch (Exception e) { return; } } Object params[] = new Object[1]; params[0] = m_truncationSnapshotPath; long handle = m_nextCallbackHandle++; m_procedureCallbacks.put(handle, new ProcedureCallback() { @Override public void clientCallback(final ClientResponse clientResponse) throws Exception { if (clientResponse.getStatus() != ClientResponse.SUCCESS){ SNAP_LOG.error(clientResponse.getStatusString()); return; } final VoltTable results[] = clientResponse.getResults(); if (results.length == 1) { final VoltTable result = results[0]; boolean advanced = result.advanceRow(); assert(advanced); assert(result.getColumnCount() == 1); assert(result.getColumnType(0) == VoltType.STRING); loggingLog.error("Snapshot scan failed with failure response: " + result.getString("ERR_MSG")); return; } assert(results.length == 3); final VoltTable snapshots = results[0]; assert(snapshots.getColumnCount() == 9); TreeMap<Long, TruncationSnapshotAttempt> foundSnapshots = new TreeMap<Long, TruncationSnapshotAttempt>(); while (snapshots.advanceRow()) { final String path = snapshots.getString("PATH"); <START> final String pathType = snapshots.getString("PATHTYPE"); <END> final String nonce = snapshots.getString("NONCE"); final Long txnId = snapshots.getLong("TXNID"); TruncationSnapshotAttempt snapshotAttempt = new TruncationSnapshotAttempt(); snapshotAttempt.path = path; snapshotAttempt.pathType = pathType; snapshotAttempt.nonce = nonce; foundSnapshots.put(txnId, snapshotAttempt); } for (Map.Entry<Long, TruncationSnapshotAttempt> entry : foundSnapshots.entrySet()) { if (!m_truncationSnapshotAttempts.containsKey(entry.getKey())) { loggingLog.info("Truncation snapshot scan discovered new snapshot txnid " + entry.getKey() + " path " + entry.getValue().path + " nonce " + entry.getValue().nonce); m_truncationSnapshotAttempts.put(entry.getKey(), entry.getValue()); } } } }); m_initiator.initiateSnapshotDaemonWork("@SnapshotScan", handle, params); }</code><technical_language>Instead of sending another variable snapshot save, leverage URI template variable</technical_language>

Target:
private void scanTruncationSnapshots() { if (m_truncationSnapshotPath == null) { try { m_truncationSnapshotPath = new String(m_zk.getData(VoltZK.test_scan_path, false, null), "UTF-8"); } catch (Exception e) { return; } } Object params[] = new Object[1]; params[0] = m_truncationSnapshotPath; long handle = m_nextCallbackHandle++; m_procedureCallbacks.put(handle, new ProcedureCallback() { @Override public void clientCallback(final ClientResponse clientResponse) throws Exception { if (clientResponse.getStatus() != ClientResponse.SUCCESS){ SNAP_LOG.error(clientResponse.getStatusString()); return; } final VoltTable results[] = clientResponse.getResults(); if (results.length == 1) { final VoltTable result = results[0]; boolean advanced = result.advanceRow(); assert(advanced); assert(result.getColumnCount() == 1); assert(result.getColumnType(0) == VoltType.STRING); loggingLog.error("Snapshot scan failed with failure response: " + result.getString("ERR_MSG")); return; } assert(results.length == 3); final VoltTable snapshots = results[0]; assert(snapshots.getColumnCount() == 10); TreeMap<Long, TruncationSnapshotAttempt> foundSnapshots = new TreeMap<Long, TruncationSnapshotAttempt>(); while (snapshots.advanceRow()) { final String path = snapshots.getString("PATH"); final String pathType = snapshots.getString("PATHTYPE"); final String nonce = snapshots.getString("NONCE"); final Long txnId = snapshots.getLong("TXNID"); TruncationSnapshotAttempt snapshotAttempt = new TruncationSnapshotAttempt(); snapshotAttempt.path = path; snapshotAttempt.pathType = pathType; snapshotAttempt.nonce = nonce; foundSnapshots.put(txnId, snapshotAttempt); } for (Map.Entry<Long, TruncationSnapshotAttempt> entry : foundSnapshots.entrySet()) { if (!m_truncationSnapshotAttempts.containsKey(entry.getKey())) { loggingLog.info("Truncation snapshot scan discovered new snapshot txnid " + entry.getKey() + " path " + entry.getValue().path + " nonce " + entry.getValue().nonce); m_truncationSnapshotAttempts.put(entry.getKey(), entry.getValue()); } } } }); m_initiator.initiateSnapshotDaemonWork("@SnapshotScan", handle, params); }