Repository: samza Updated Branches: refs/heads/master 11471672d -> 6c9715fbc
http://git-wip-us.apache.org/repos/asf/samza/blob/6c9715fb/docs/img/versioned/learn/documentation/api/table-class-diagram.svg ---------------------------------------------------------------------- diff --git a/docs/img/versioned/learn/documentation/api/table-class-diagram.svg b/docs/img/versioned/learn/documentation/api/table-class-diagram.svg new file mode 100644 index 0000000..ae604c0 --- /dev/null +++ b/docs/img/versioned/learn/documentation/api/table-class-diagram.svg @@ -0,0 +1,370 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="161.74503mm" + height="112.12096mm" + viewBox="0 0 161.74503 112.12096" + version="1.1" + id="svg142" + inkscape:version="0.92.3 (2405546, 2018-03-11)" + sodipodi:docname="table2.svg"> + <defs + id="defs136"> + <clipPath + id="clipEmfPath1" + clipPathUnits="userSpaceOnUse"> + <path + id="path144" + d="M 0,0 H 613.35144 V 426.00979 H 0 Z" + inkscape:connector-curvature="0" /> + </clipPath> + <pattern + y="0" + x="0" + height="6" + width="6" + patternUnits="userSpaceOnUse" + id="EMFhbasepattern" /> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="0.35" + inkscape:cx="305.65988" + inkscape:cy="211.88212" + inkscape:document-units="mm" + inkscape:current-layer="layer1" + showgrid="false" + fit-margin-top="0" + fit-margin-left="0" + fit-margin-right="0" + fit-margin-bottom="0" + inkscape:window-width="1366" + inkscape:window-height="705" + inkscape:window-x="-8" + inkscape:window-y="-8" + inkscape:window-maximized="1" /> + <metadata + id="metadata139"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1" + transform="translate(-24.960824,-92.772856)"> + <path + id="path150" + d="m 82.032741,92.80822 v 13.62257 H 126.91791 V 92.80822 Z" + style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.26458332" + inkscape:connector-curvature="0" /> + <path + id="path152" + d="M 216.74745,52.502712 H 386.39216 V 1.0158366 H 216.74745 Z" + clip-path="url(#clipEmfPath1)" + style="fill:none;stroke:#000000;stroke-width:0.26732543px;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + inkscape:connector-curvature="0" + transform="matrix(0.26458333,0,0,0.26458333,24.684978,92.539447)" /> + <text + id="text158" + y="98.461517" + x="92.679207" + style="font-style:normal;font-variant:normal;font-weight:400;font-size:4.29947901px;line-height:125%;font-family:Calibri;text-align:start;letter-spacing:0px;word-spacing:0px;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" + xml:space="preserve"><tspan + id="tspan156" + y="98.461517" + x="92.679207" + sodipodi:role="line" + style="stroke-width:0.26458332"><tspan + id="tspan154" + style="font-style:normal;font-variant:normal;font-weight:400;font-size:4.29947901px;font-family:Calibri;fill:#000000;stroke-width:0.26458332" + dy="0" + dx="0"><<interface>></tspan></tspan></text> + <text + id="text164" + y="103.53136" + x="99.891167" + style="font-style:normal;font-variant:normal;font-weight:400;font-size:4.29947901px;line-height:125%;font-family:Calibri;text-align:start;letter-spacing:0px;word-spacing:0px;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" + xml:space="preserve"><tspan + id="tspan162" + y="103.53136" + x="99.891167" + sodipodi:role="line" + style="stroke-width:0.26458332"><tspan + id="tspan160" + style="font-style:normal;font-variant:normal;font-weight:400;font-size:4.29947901px;font-family:Calibri;fill:#000000;stroke-width:0.26458332" + dy="0" + dx="0">Table</tspan></tspan></text> + <path + id="path166" + d="m 82.032741,113.85742 v 13.62257 h 44.885169 v -13.62257 z" + style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.26458332" + inkscape:connector-curvature="0" /> + <path + id="path168" + d="M 82.032741,127.47999 H 126.91791 V 113.85742 H 82.032741 Z" + style="fill:none;stroke:#000000;stroke-width:0.07072985px;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + inkscape:connector-curvature="0" /> + <text + id="text174" + y="119.51072" + x="92.679207" + style="font-style:normal;font-variant:normal;font-weight:400;font-size:4.29947901px;line-height:125%;font-family:Calibri;text-align:start;letter-spacing:0px;word-spacing:0px;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" + xml:space="preserve"><tspan + id="tspan172" + y="119.51072" + x="92.679207" + sodipodi:role="line" + style="stroke-width:0.26458332"><tspan + id="tspan170" + style="font-style:normal;font-variant:normal;font-weight:400;font-size:4.29947901px;font-family:Calibri;fill:#000000;stroke-width:0.26458332" + dy="0" + dx="0"><<interface>></tspan></tspan></text> + <text + id="text180" + y="124.58056" + x="91.91375" + style="font-style:normal;font-variant:normal;font-weight:400;font-size:4.29947901px;line-height:125%;font-family:Calibri;text-align:start;letter-spacing:0px;word-spacing:0px;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" + xml:space="preserve"><tspan + id="tspan178" + y="124.58056" + x="91.91375" + sodipodi:role="line" + style="stroke-width:0.26458332"><tspan + id="tspan176" + style="font-style:normal;font-variant:normal;font-weight:400;font-size:4.29947901px;font-family:Calibri;fill:#000000;stroke-width:0.26458332" + dy="0" + dx="0">ReadableTable</tspan></tspan></text> + <path + id="path182" + d="M 82.032741,134.90663 V 148.5292 H 126.91791 V 134.90663 Z" + style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.26458332" + inkscape:connector-curvature="0" /> + <path + id="path184" + d="M 82.032741,148.5292 H 126.91791 V 134.90663 H 82.032741 Z" + style="fill:none;stroke:#000000;stroke-width:0.07072985px;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + inkscape:connector-curvature="0" /> + <text + id="text190" + y="140.55992" + x="92.679207" + style="font-style:normal;font-variant:normal;font-weight:400;font-size:4.29947901px;line-height:125%;font-family:Calibri;text-align:start;letter-spacing:0px;word-spacing:0px;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" + xml:space="preserve"><tspan + id="tspan188" + y="140.55992" + x="92.679207" + sodipodi:role="line" + style="stroke-width:0.26458332"><tspan + id="tspan186" + style="font-style:normal;font-variant:normal;font-weight:400;font-size:4.29947901px;font-family:Calibri;fill:#000000;stroke-width:0.26458332" + dy="0" + dx="0"><<interface>></tspan></tspan></text> + <text + id="text196" + y="145.62976" + x="90.712067" + style="font-style:normal;font-variant:normal;font-weight:400;font-size:4.29947901px;line-height:125%;font-family:Calibri;text-align:start;letter-spacing:0px;word-spacing:0px;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" + xml:space="preserve"><tspan + id="tspan194" + y="145.62976" + x="90.712067" + sodipodi:role="line" + style="stroke-width:0.26458332"><tspan + id="tspan192" + style="font-style:normal;font-variant:normal;font-weight:400;font-size:4.29947901px;font-family:Calibri;fill:#000000;stroke-width:0.26458332" + dy="0" + dx="0">ReadWriteTable</tspan></tspan></text> + <path + id="path198" + d="m 104.46825,113.85742 v -4.45598" + style="fill:none;stroke:#000000;stroke-width:0.22633553px;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + inkscape:connector-curvature="0" /> + <path + id="path200" + d="m 105.45847,109.40144 -0.99022,-2.97065 -0.99022,2.97065 z" + style="fill:none;stroke:#000000;stroke-width:0.22633553px;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + inkscape:connector-curvature="0" /> + <path + id="path202" + d="m 104.46825,134.90663 v -4.45598" + style="fill:none;stroke:#000000;stroke-width:0.22633553px;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + inkscape:connector-curvature="0" /> + <path + id="path204" + d="m 105.45847,130.45065 -0.99022,-2.97066 -0.99022,2.97066 z" + style="fill:none;stroke:#000000;stroke-width:0.22633553px;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + inkscape:connector-curvature="0" /> + <path + id="path206" + d="m 81.028377,165.44778 v 13.63671 h 44.885163 v -13.63671 z" + style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.26458332" + inkscape:connector-curvature="0" /> + <path + id="path208" + d="M 81.028377,179.08449 H 125.91354 V 165.44778 H 81.028377 Z" + style="fill:none;stroke:#000000;stroke-width:0.07072985px;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + inkscape:connector-curvature="0" /> + <text + id="text214" + y="171.10335" + x="91.679832" + style="font-style:normal;font-variant:normal;font-weight:400;font-size:4.29947901px;line-height:125%;font-family:Calibri;text-align:start;letter-spacing:0px;word-spacing:0px;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" + xml:space="preserve"><tspan + id="tspan212" + y="171.10335" + x="91.679832" + sodipodi:role="line" + style="stroke-width:0.26458332"><tspan + id="tspan210" + style="font-style:normal;font-variant:normal;font-weight:400;font-size:4.29947901px;font-family:Calibri;fill:#000000;stroke-width:0.26458332" + dy="0" + dx="0"><<interface>></tspan></tspan></text> + <text + id="text220" + y="176.17319" + x="89.932335" + style="font-style:normal;font-variant:normal;font-weight:400;font-size:4.29947901px;line-height:125%;font-family:Calibri;text-align:start;letter-spacing:0px;word-spacing:0px;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" + xml:space="preserve"><tspan + id="tspan218" + y="176.17319" + x="89.932335" + sodipodi:role="line" + style="stroke-width:0.26458332"><tspan + id="tspan216" + style="font-style:normal;font-variant:normal;font-weight:400;font-size:4.29947901px;font-family:Calibri;fill:#000000;stroke-width:0.26458332" + dy="0" + dx="0">TableDescriptor</tspan></tspan></text> + <path + id="path222" + d="m 24.996189,191.23588 v 13.62257 h 44.885163 v -13.62257 z" + style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.26458332" + inkscape:connector-curvature="0" /> + <path + id="path224" + d="M 1.1762318,424.51276 H 170.82094 V 373.02589 H 1.1762318 Z" + clip-path="url(#clipEmfPath1)" + style="fill:none;stroke:#000000;stroke-width:0.26732543px;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + inkscape:connector-curvature="0" + transform="matrix(0.26458333,0,0,0.26458333,24.684978,92.539447)" /> + <text + id="text230" + y="199.41685" + x="27.136927" + style="font-style:normal;font-variant:normal;font-weight:400;font-size:4.29947901px;line-height:125%;font-family:Calibri;text-align:start;letter-spacing:0px;word-spacing:0px;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" + xml:space="preserve"><tspan + id="tspan228" + y="199.41685" + x="27.136927" + sodipodi:role="line" + style="stroke-width:0.26458332"><tspan + id="tspan226" + style="font-style:normal;font-variant:normal;font-weight:400;font-size:4.29947901px;font-family:Calibri;fill:#000000;stroke-width:0.26458332" + dy="0" + dx="0">RemoteTableDescriptor</tspan></tspan></text> + <path + id="path232" + d="m 78.666,191.23588 v 13.62257 h 49.60992 v -13.62257 z" + style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.26458332" + inkscape:connector-curvature="0" /> + <path + id="path234" + d="M 204.02276,424.51276 H 391.52481 V 373.02589 H 204.02276 Z" + clip-path="url(#clipEmfPath1)" + style="fill:none;stroke:#000000;stroke-width:0.26732543px;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + inkscape:connector-curvature="0" + transform="matrix(0.26458333,0,0,0.26458333,24.684978,92.539447)" /> + <text + id="text240" + y="199.41685" + x="80.938965" + style="font-style:normal;font-variant:normal;font-weight:400;font-size:4.29947901px;line-height:125%;font-family:Calibri;text-align:start;letter-spacing:0px;word-spacing:0px;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" + xml:space="preserve"><tspan + id="tspan238" + y="199.41685" + x="80.938965" + sodipodi:role="line" + style="stroke-width:0.26458332"><tspan + id="tspan236" + style="font-style:normal;font-variant:normal;font-weight:400;font-size:4.29947901px;font-family:Calibri;fill:#000000;stroke-width:0.26458332" + dy="0" + dx="0">InMemoryTableDescriptor</tspan></tspan></text> + <path + id="path242" + d="m 137.06056,191.23588 v 13.62257 h 49.60992 v -13.62257 z" + style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.26458332" + inkscape:connector-curvature="0" /> + <path + id="path244" + d="M 424.72662,424.51276 H 612.22867 V 373.02589 H 424.72662 Z" + clip-path="url(#clipEmfPath1)" + style="fill:none;stroke:#000000;stroke-width:0.26732543px;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + inkscape:connector-curvature="0" + transform="matrix(0.26458333,0,0,0.26458333,24.684978,92.539447)" /> + <text + id="text250" + y="199.41685" + x="140.97668" + style="font-style:normal;font-variant:normal;font-weight:400;font-size:4.29947901px;line-height:125%;font-family:Calibri;text-align:start;letter-spacing:0px;word-spacing:0px;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" + xml:space="preserve"><tspan + id="tspan248" + y="199.41685" + x="140.97668" + sodipodi:role="line" + style="stroke-width:0.26458332"><tspan + id="tspan246" + style="font-style:normal;font-variant:normal;font-weight:400;font-size:4.29947901px;font-family:Calibri;fill:#000000;stroke-width:0.26458332" + dy="0" + dx="0">RocksDbTableDescriptor</tspan></tspan></text> + <path + id="path252" + d="m 47.31853,191.23588 v -1.58435 c 0,-0.0707 0.05658,-0.11317 0.113168,-0.11317 0.07073,0 0.113168,0.0424 0.113168,0.11317 v 1.58435 c 0,0.0566 -0.04244,0.11317 -0.113168,0.11317 -0.05658,0 -0.113168,-0.0566 -0.113168,-0.11317 z m 0,-2.71603 v -1.58435 c 0,-0.0707 0.05658,-0.11316 0.113168,-0.11316 0.07073,0 0.113168,0.0424 0.113168,0.11316 v 1.58435 c 0,0.0566 -0.04244,0.11317 -0.113168,0.11317 -0.05658,0 -0.113168,-0.0566 -0.113168,-0.11317 z m 0.113168,-2.82919 h 1.584349 c 0.07073,0 0.113167,0.0424 0.113167,0.11317 0,0.0566 -0.04244,0.11317 -0.113167,0.11317 h -1.584349 c -0.05658,0 -0.113168,-0.0566 -0.113168,-0.11317 0,-0.0707 0.05658,-0.11317 0.113168,-0.11317 z m 2.716026,0 h 1.584349 c 0.07073,0 0.113167,0.0424 0.113167,0.11317 0,0.0566 -0.04244,0.11317 -0.113167,0.11317 h -1.584349 c -0.05658,0 -0.113168,-0.0566 -0.113168,-0.11317 0,-0.0707 0.05658,-0.11317 0.113168,-0.11317 z m 2.716027,0 H 54.4481 c 0.07073,0 0.113168,0.0424 0.113168,0.11317 0,0.0566 -0.04244,0. 11317 -0.113168,0.11317 h -1.584349 c -0.05658,0 -0.113167,-0.0566 -0.113167,-0.11317 0,-0.0707 0.05658,-0.11317 0.113167,-0.11317 z m 2.716025,0 h 1.584349 c 0.07073,0 0.113167,0.0424 0.113167,0.11317 0,0.0566 -0.04244,0.11317 -0.113167,0.11317 h -1.584349 c -0.05658,0 -0.113168,-0.0566 -0.113168,-0.11317 0,-0.0707 0.05658,-0.11317 0.113168,-0.11317 z m 2.716027,0 h 1.584349 c 0.07073,0 0.113168,0.0424 0.113168,0.11317 0,0.0566 -0.04244,0.11317 -0.113168,0.11317 h -1.584349 c -0.05658,0 -0.113167,-0.0566 -0.113167,-0.11317 0,-0.0707 0.05658,-0.11317 0.113167,-0.11317 z m 2.716025,0 h 1.584349 c 0.07073,0 0.113167,0.0424 0.113167,0.11317 0,0.0566 -0.04244,0.11317 -0.113167,0.11317 h -1.584349 c -0.05658,0 -0.113168,-0.0566 -0.113168,-0.11317 0,-0.0707 0.05658,-0.11317 0.113168,-0.11317 z m 2.716027,0 h 1.584349 c 0.07073,0 0.113167,0.0424 0.113167,0.11317 0,0.0566 -0.04244,0.11317 -0.113167,0.11317 h -1.584349 c -0.05658,0 -0.113167,-0.0566 -0.113167,-0.11317 0,-0.0707 0.05658,-0.11 317 0.113167,-0.11317 z m 2.716027,0 h 1.584349 c 0.07073,0 0.113168,0.0424 0.113168,0.11317 0,0.0566 -0.04244,0.11317 -0.113168,0.11317 h -1.584349 c -0.05658,0 -0.113167,-0.0566 -0.113167,-0.11317 0,-0.0707 0.05658,-0.11317 0.113167,-0.11317 z m 2.716025,0 h 1.584349 c 0.07073,0 0.113167,0.0424 0.113167,0.11317 0,0.0566 -0.04244,0.11317 -0.113167,0.11317 h -1.584349 c -0.05658,0 -0.113168,-0.0566 -0.113168,-0.11317 0,-0.0707 0.05658,-0.11317 0.113168,-0.11317 z m 2.716027,0 h 1.584349 c 0.07073,0 0.113168,0.0424 0.113168,0.11317 0,0.0566 -0.04244,0.11317 -0.113168,0.11317 h -1.584349 c -0.05658,0 -0.113167,-0.0566 -0.113167,-0.11317 0,-0.0707 0.05658,-0.11317 0.113167,-0.11317 z m 2.716025,0 h 1.584349 c 0.07073,0 0.113167,0.0424 0.113167,0.11317 0,0.0566 -0.04244,0.11317 -0.113167,0.11317 h -1.584349 c -0.05658,0 -0.113168,-0.0566 -0.113168,-0.11317 0,-0.0707 0.05658,-0.11317 0.113168,-0.11317 z m 2.716027,0 h 1.584349 c 0.07073,0 0.113168,0.0424 0.113168,0.11317 0,0.0566 -0.0424 4,0.11317 -0.113168,0.11317 h -1.584349 c -0.05658,0 -0.113167,-0.0566 -0.113167,-0.11317 0,-0.0707 0.05658,-0.11317 0.113167,-0.11317 z m 2.716028,0 h 1.584348 c 0.07073,0 0.113168,0.0424 0.113168,0.11317 0,0.0566 -0.04244,0.11317 -0.113168,0.11317 h -1.584348 c -0.05658,0 -0.113168,-0.0566 -0.113168,-0.11317 0,-0.0707 0.05658,-0.11317 0.113168,-0.11317 z m 2.716024,0 h 1.584349 c 0.07073,0 0.113168,0.0424 0.113168,0.11317 0,0.0566 -0.04244,0.11317 -0.113168,0.11317 h -1.584349 c -0.05658,0 -0.113167,-0.0566 -0.113167,-0.11317 0,-0.0707 0.05658,-0.11317 0.113167,-0.11317 z m 2.716027,0 h 1.584349 c 0.07073,0 0.113168,0.0424 0.113168,0.11317 0,0.0566 -0.04244,0.11317 -0.113168,0.11317 h -1.584349 c -0.05658,0 -0.113167,-0.0566 -0.113167,-0.11317 0,-0.0707 0.05658,-0.11317 0.113167,-0.11317 z m 2.716025,0 h 1.584349 c 0.07073,0 0.113168,0.0424 0.113168,0.11317 0,0.0566 -0.04244,0.11317 -0.113168,0.11317 H 88.17209 c -0.05658,0 -0.113167,-0.0566 -0.113167,-0.11317 0,-0.0707 0.05658,-0 .11317 0.113167,-0.11317 z m 2.716027,0 h 1.584349 c 0.07073,0 0.113168,0.0424 0.113168,0.11317 0,0.0566 -0.04244,0.11317 -0.113168,0.11317 h -1.584349 c -0.05658,0 -0.113167,-0.0566 -0.113167,-0.11317 0,-0.0707 0.05658,-0.11317 0.113167,-0.11317 z m 2.716028,0 h 1.584349 c 0.07073,0 0.113167,0.0424 0.113167,0.11317 0,0.0566 -0.04244,0.11317 -0.113167,0.11317 h -1.584349 c -0.05658,0 -0.113168,-0.0566 -0.113168,-0.11317 0,-0.0707 0.05658,-0.11317 0.113168,-0.11317 z m 2.716024,0 h 1.584349 c 0.07073,0 0.113168,0.0424 0.113168,0.11317 0,0.0566 -0.04244,0.11317 -0.113168,0.11317 h -1.584349 c -0.05658,0 -0.113167,-0.0566 -0.113167,-0.11317 0,-0.0707 0.05658,-0.11317 0.113167,-0.11317 z m 2.716028,0 h 1.584343 c 0.0707,0 0.11317,0.0424 0.11317,0.11317 0,0.0566 -0.0424,0.11317 -0.11317,0.11317 h -1.584343 c -0.05658,0 -0.113168,-0.0566 -0.113168,-0.11317 0,-0.0707 0.05658,-0.11317 0.113168,-0.11317 z m 2.716023,0 h 1.58435 c 0.0707,0 0.11317,0.0424 0.11317,0.11317 0,0.0566 -0.0424,0.113 17 -0.11317,0.11317 h -1.58435 c -0.0566,0 -0.11317,-0.0566 -0.11317,-0.11317 0,-0.0707 0.0566,-0.11317 0.11317,-0.11317 z m 1.61264,-0.8912 v -1.58434 c 0,-0.0707 0.0424,-0.11317 0.11317,-0.11317 0.0566,0 0.11317,0.0424 0.11317,0.11317 v 1.58434 c 0,0.0566 -0.0566,0.11317 -0.11317,0.11317 -0.0707,0 -0.11317,-0.0566 -0.11317,-0.11317 z m 0,-2.71602 v -0.0424 c 0,-0.0707 0.0424,-0.11317 0.11317,-0.11317 0.0566,0 0.11317,0.0424 0.11317,0.11317 v 0.0424 c 0,0.0566 -0.0566,0.11316 -0.11317,0.11316 -0.0707,0 -0.11317,-0.0566 -0.11317,-0.11316 z" + style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.01414597px;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + inkscape:connector-curvature="0" /> + <path + id="path254" + d="m 104.4541,182.041 -0.97607,-2.95651 -0.99022,2.95651 z" + style="fill:none;stroke:#000000;stroke-width:0.22633553px;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + inkscape:connector-curvature="0" /> + <path + id="path256" + d="m 103.36486,191.23588 v -1.58435 c 0,-0.0707 0.0424,-0.11317 0.11317,-0.11317 0.0566,0 0.11317,0.0424 0.11317,0.11317 v 1.58435 c 0,0.0566 -0.0566,0.11317 -0.11317,0.11317 -0.0707,0 -0.11317,-0.0566 -0.11317,-0.11317 z m 0,-2.71603 v -1.58435 c 0,-0.0707 0.0424,-0.11316 0.11317,-0.11316 0.0566,0 0.11317,0.0424 0.11317,0.11316 v 1.58435 c 0,0.0566 -0.0566,0.11317 -0.11317,0.11317 -0.0707,0 -0.11317,-0.0566 -0.11317,-0.11317 z m 0,-2.71602 v -1.58435 c 0,-0.0707 0.0424,-0.11317 0.11317,-0.11317 0.0566,0 0.11317,0.0424 0.11317,0.11317 v 1.58435 c 0,0.0566 -0.0566,0.11317 -0.11317,0.11317 -0.0707,0 -0.11317,-0.0566 -0.11317,-0.11317 z m 0,-2.71603 v -1.0468 c 0,-0.0707 0.0424,-0.11317 0.11317,-0.11317 0.0566,0 0.11317,0.0424 0.11317,0.11317 v 1.0468 c 0,0.0566 -0.0566,0.11317 -0.11317,0.11317 -0.0707,0 -0.11317,-0.0566 -0.11317,-0.11317 z" + style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.01414597px;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + inkscape:connector-curvature="0" /> + <path + id="path258" + d="m 104.4541,182.041 -0.97607,-2.95651 -0.99022,2.95651 z" + style="fill:none;stroke:#000000;stroke-width:0.22633553px;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + inkscape:connector-curvature="0" /> + <path + id="path260" + d="m 161.75943,191.23588 v -1.58435 c 0,-0.0707 0.0424,-0.11317 0.11317,-0.11317 0.0566,0 0.11316,0.0424 0.11316,0.11317 v 1.58435 c 0,0.0566 -0.0566,0.11317 -0.11316,0.11317 -0.0707,0 -0.11317,-0.0566 -0.11317,-0.11317 z m 0,-2.71603 v -1.58435 c 0,-0.0707 0.0424,-0.11316 0.11317,-0.11316 0.0566,0 0.11316,0.0424 0.11316,0.11316 v 1.58435 c 0,0.0566 -0.0566,0.11317 -0.11316,0.11317 -0.0707,0 -0.11317,-0.0566 -0.11317,-0.11317 z m 0.11317,-2.60285 h -1.58435 c -0.0707,0 -0.11317,-0.0566 -0.11317,-0.11317 0,-0.0707 0.0424,-0.11317 0.11317,-0.11317 h 1.58435 c 0.0566,0 0.11316,0.0424 0.11316,0.11317 0,0.0566 -0.0566,0.11317 -0.11316,0.11317 z m -2.71603,0 h -1.58435 c -0.0707,0 -0.11317,-0.0566 -0.11317,-0.11317 0,-0.0707 0.0424,-0.11317 0.11317,-0.11317 h 1.58435 c 0.0566,0 0.11317,0.0424 0.11317,0.11317 0,0.0566 -0.0566,0.11317 -0.11317,0.11317 z m -2.71602,0 h -1.58435 c -0.0707,0 -0.11317,-0.0566 -0.11317,-0.11317 0,-0.0707 0.0424,-0.11317 0.11317,-0.11317 h 1.58435 c 0.0566 ,0 0.11316,0.0424 0.11316,0.11317 0,0.0566 -0.0566,0.11317 -0.11316,0.11317 z m -2.71603,0 h -1.58435 c -0.0707,0 -0.11317,-0.0566 -0.11317,-0.11317 0,-0.0707 0.0424,-0.11317 0.11317,-0.11317 h 1.58435 c 0.0566,0 0.11317,0.0424 0.11317,0.11317 0,0.0566 -0.0566,0.11317 -0.11317,0.11317 z m -2.71603,0 h -1.58435 c -0.0707,0 -0.11316,-0.0566 -0.11316,-0.11317 0,-0.0707 0.0424,-0.11317 0.11316,-0.11317 h 1.58435 c 0.0566,0 0.11317,0.0424 0.11317,0.11317 0,0.0566 -0.0566,0.11317 -0.11317,0.11317 z m -2.71602,0 h -1.58435 c -0.0707,0 -0.11317,-0.0566 -0.11317,-0.11317 0,-0.0707 0.0424,-0.11317 0.11317,-0.11317 h 1.58435 c 0.0566,0 0.11316,0.0424 0.11316,0.11317 0,0.0566 -0.0566,0.11317 -0.11316,0.11317 z m -2.71603,0 h -1.58435 c -0.0707,0 -0.11317,-0.0566 -0.11317,-0.11317 0,-0.0707 0.0424,-0.11317 0.11317,-0.11317 h 1.58435 c 0.0566,0 0.11317,0.0424 0.11317,0.11317 0,0.0566 -0.0566,0.11317 -0.11317,0.11317 z m -2.71603,0 h -1.58434 c -0.0707,0 -0.11317,-0.0566 -0.11317,-0.11317 0,-0.070 7 0.0424,-0.11317 0.11317,-0.11317 h 1.58434 c 0.0566,0 0.11317,0.0424 0.11317,0.11317 0,0.0566 -0.0566,0.11317 -0.11317,0.11317 z m -2.71602,0 h -1.58435 c -0.0707,0 -0.11317,-0.0566 -0.11317,-0.11317 0,-0.0707 0.0424,-0.11317 0.11317,-0.11317 h 1.58435 c 0.0566,0 0.11316,0.0424 0.11316,0.11317 0,0.0566 -0.0566,0.11317 -0.11316,0.11317 z m -2.71603,0 h -1.58435 c -0.0707,0 -0.11316,-0.0566 -0.11316,-0.11317 0,-0.0707 0.0424,-0.11317 0.11316,-0.11317 h 1.58435 c 0.0566,0 0.11317,0.0424 0.11317,0.11317 0,0.0566 -0.0566,0.11317 -0.11317,0.11317 z m -2.71603,0 h -1.58434 c -0.0707,0 -0.11317,-0.0566 -0.11317,-0.11317 0,-0.0707 0.0424,-0.11317 0.11317,-0.11317 h 1.58434 c 0.0566,0 0.11317,0.0424 0.11317,0.11317 0,0.0566 -0.0566,0.11317 -0.11317,0.11317 z m -2.71602,0 h -1.58435 c -0.0707,0 -0.11317,-0.0566 -0.11317,-0.11317 0,-0.0707 0.0424,-0.11317 0.11317,-0.11317 h 1.58435 c 0.0566,0 0.11317,0.0424 0.11317,0.11317 0,0.0566 -0.0566,0.11317 -0.11317,0.11317 z m -2.71603,0 h -1.58435 c -0.0707,0 -0.11316,-0.0566 -0.11316,-0.11317 0,-0.0707 0.0424,-0.11317 0.11316,-0.11317 h 1.58435 c 0.0566,0 0.11317,0.0424 0.11317,0.11317 0,0.0566 -0.0566,0.11317 -0.11317,0.11317 z m -2.71602,0 h -1.58435 c -0.0707,0 -0.11317,-0.0566 -0.11317,-0.11317 0,-0.0707 0.0424,-0.11317 0.11317,-0.11317 h 1.58435 c 0.0566,0 0.11316,0.0424 0.11316,0.11317 0,0.0566 -0.0566,0.11317 -0.11316,0.11317 z m -2.71603,0 h -1.58435 c -0.0707,0 -0.11317,-0.0566 -0.11317,-0.11317 0,-0.0707 0.0424,-0.11317 0.11317,-0.11317 h 1.58435 c 0.0566,0 0.11317,0.0424 0.11317,0.11317 0,0.0566 -0.0566,0.11317 -0.11317,0.11317 z m -2.71603,0 h -1.58435 c -0.0707,0 -0.11317,-0.0566 -0.11317,-0.11317 0,-0.0707 0.0424,-0.11317 0.11317,-0.11317 h 1.58435 c 0.0566,0 0.11317,0.0424 0.11317,0.11317 0,0.0566 -0.0566,0.11317 -0.11317,0.11317 z m -2.71603,0 h -1.58434 c -0.0707,0 -0.11317,-0.0566 -0.11317,-0.11317 0,-0.0707 0.0424,-0.11317 0.11317,-0.11317 h 1.58434 c 0.0566,0 0.11317,0.0424 0.11317,0.11317 0,0.0566 -0.0566, 0.11317 -0.11317,0.11317 z m -2.71602,0 h -1.58435 c -0.0707,0 -0.11317,-0.0566 -0.11317,-0.11317 0,-0.0707 0.0424,-0.11317 0.11317,-0.11317 h 1.58435 c 0.0566,0 0.11317,0.0424 0.11317,0.11317 0,0.0566 -0.0566,0.11317 -0.11317,0.11317 z m -2.71603,0 h -1.58435 c -0.0707,0 -0.11316,-0.0566 -0.11316,-0.11317 0,-0.0707 0.0424,-0.11317 0.11316,-0.11317 h 1.58435 c 0.0566,0 0.11317,0.0424 0.11317,0.11317 0,0.0566 -0.0566,0.11317 -0.11317,0.11317 z m -2.71602,0 h -1.58435 c -0.0707,0 -0.11317,-0.0566 -0.11317,-0.11317 0,-0.0707 0.0424,-0.11317 0.11317,-0.11317 h 1.58435 c 0.0566,0 0.11316,0.0424 0.11316,0.11317 0,0.0566 -0.0566,0.11317 -0.11316,0.11317 z m -2.71603,0 h -1.58435 c -0.0707,0 -0.11317,-0.0566 -0.11317,-0.11317 0,-0.0707 0.0424,-0.11317 0.11317,-0.11317 h 1.58435 c 0.0566,0 0.11317,0.0424 0.11317,0.11317 0,0.0566 -0.0566,0.11317 -0.11317,0.11317 z m -2.71603,0 h -1.35801 c -0.0707,0 -0.11317,-0.0566 -0.11317,-0.11317 v -0.22634 c 0,-0.0707 0.0424,-0.11317 0.11317,-0.11317 0.0 566,0 0.11317,0.0424 0.11317,0.11317 v 0.22634 l -0.11317,-0.11317 h 1.35801 c 0.0566,0 0.11317,0.0424 0.11317,0.11317 0,0.0566 -0.0566,0.11317 -0.11317,0.11317 z m -1.47118,-1.47119 v -1.58434 c 0,-0.0707 0.0424,-0.11317 0.11317,-0.11317 0.0566,0 0.11317,0.0424 0.11317,0.11317 v 1.58434 c 0,0.0566 -0.0566,0.11317 -0.11317,0.11317 -0.0707,0 -0.11317,-0.0566 -0.11317,-0.11317 z" + style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.01414597px;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + inkscape:connector-curvature="0" /> + <path + id="path262" + d="m 104.4541,182.041 -0.97607,-2.95651 -0.99022,2.95651 z" + style="fill:none;stroke:#000000;stroke-width:0.22633553px;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + inkscape:connector-curvature="0" /> + </g> +</svg> http://git-wip-us.apache.org/repos/asf/samza/blob/6c9715fb/docs/img/versioned/learn/documentation/api/table-descriptor-class-diagram.svg ---------------------------------------------------------------------- diff --git a/docs/img/versioned/learn/documentation/api/table-descriptor-class-diagram.svg b/docs/img/versioned/learn/documentation/api/table-descriptor-class-diagram.svg new file mode 100644 index 0000000..df3d213 --- /dev/null +++ b/docs/img/versioned/learn/documentation/api/table-descriptor-class-diagram.svg @@ -0,0 +1,270 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="85.625557mm" + height="60.502312mm" + viewBox="0 0 85.625557 60.502312" + version="1.1" + id="svg8" + inkscape:version="0.92.3 (2405546, 2018-03-11)" + sodipodi:docname="table1.svg"> + <defs + id="defs2"> + <clipPath + id="clipEmfPath1" + clipPathUnits="userSpaceOnUse"> + <path + id="path10" + d="M 0,0 H 325.92315 V 230.96916 H 0 Z" + inkscape:connector-curvature="0" /> + </clipPath> + <pattern + y="0" + x="0" + height="6" + width="6" + patternUnits="userSpaceOnUse" + id="EMFhbasepattern" /> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="0.35" + inkscape:cx="216.09779" + inkscape:cy="-19.950636" + inkscape:document-units="mm" + inkscape:current-layer="layer1" + showgrid="false" + fit-margin-top="0" + fit-margin-left="0" + fit-margin-right="0" + fit-margin-bottom="0" + inkscape:window-width="1366" + inkscape:window-height="705" + inkscape:window-x="-8" + inkscape:window-y="-8" + inkscape:window-maximized="1" /> + <metadata + id="metadata5"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1" + transform="translate(-48.657461,-83.052416)"> + <path + id="path16" + d="M 48.692826,83.08778 V 94.630892 H 86.717193 V 83.08778 Z" + style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.26458332" + inkscape:connector-curvature="0" /> + <path + id="path18" + d="M 1.0158366,44.643345 H 144.72998 V 1.0158366 H 1.0158366 Z" + clip-path="url(#clipEmfPath1)" + style="fill:none;stroke:#000000;stroke-width:0.26732543px;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + inkscape:connector-curvature="0" + transform="matrix(0.26458333,0,0,0.26458333,48.424052,82.819007)" /> + <text + id="text24" + y="88.060989" + x="59.312599" + style="font-style:normal;font-variant:normal;font-weight:400;font-size:2.94348955px;line-height:125%;font-family:Calibri;text-align:start;letter-spacing:0px;word-spacing:0px;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" + xml:space="preserve"><tspan + id="tspan22" + y="88.060989" + x="59.312599" + sodipodi:role="line" + style="stroke-width:0.26458332"><tspan + id="tspan20" + style="font-style:normal;font-variant:normal;font-weight:400;font-size:2.94348955px;font-family:Calibri;fill:#000000;stroke-width:0.26458332" + dy="0" + dx="0"><<interface>></tspan></tspan></text> + <text + id="text30" + y="91.682304" + x="58.064411" + style="font-style:normal;font-variant:normal;font-weight:400;font-size:2.94348955px;line-height:125%;font-family:Calibri;text-align:start;letter-spacing:0px;word-spacing:0px;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" + xml:space="preserve"><tspan + id="tspan28" + y="91.682304" + x="58.064411" + sodipodi:role="line" + style="stroke-width:0.26458332"><tspan + id="tspan26" + style="font-style:normal;font-variant:normal;font-weight:400;font-size:2.94348955px;font-family:Calibri;fill:#000000;stroke-width:0.26458332" + dy="0" + dx="0">TableDescriptor</tspan></tspan></text> + <path + id="path32" + d="m 48.692826,102.09996 v 11.54312 h 38.024367 v -11.54312 z" + style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.26458332" + inkscape:connector-curvature="0" /> + <path + id="path34" + d="M 1.0158366,116.50042 H 144.72998 V 72.872909 H 1.0158366 Z" + clip-path="url(#clipEmfPath1)" + style="fill:none;stroke:#000000;stroke-width:0.26732543px;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + inkscape:connector-curvature="0" + transform="matrix(0.26458333,0,0,0.26458333,48.424052,82.819007)" /> + <text + id="text40" + y="108.88383" + x="53.237019" + style="font-style:normal;font-variant:normal;font-weight:400;font-size:2.94348955px;line-height:125%;font-family:Calibri;text-align:start;letter-spacing:0px;word-spacing:0px;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" + xml:space="preserve"><tspan + id="tspan38" + y="108.88383" + x="53.237019" + sodipodi:role="line" + style="stroke-width:0.26458332"><tspan + id="tspan36" + style="font-style:normal;font-variant:normal;font-weight:400;font-size:2.94348955px;font-family:Calibri;fill:#000000;stroke-width:0.26458332" + dy="0" + dx="0">RemoteTableDescriptor</tspan></tspan></text> + <path + id="path42" + d="m 67.591841,102.09996 v -1.58435 c 0,-0.0566 0.05658,-0.11316 0.113168,-0.11316 0.05658,0 0.113168,0.0566 0.113168,0.11316 v 1.58435 c 0,0.0566 -0.05658,0.11317 -0.113168,0.11317 -0.05658,0 -0.113168,-0.0566 -0.113168,-0.11317 z m 0,-2.716022 v -1.584349 c 0,-0.05658 0.05658,-0.113167 0.113168,-0.113167 0.05658,0 0.113168,0.05658 0.113168,0.113167 v 1.584349 c 0,0.05658 -0.05658,0.113168 -0.113168,0.113168 -0.05658,0 -0.113168,-0.05658 -0.113168,-0.113168 z" + style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.01414597px;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + inkscape:connector-curvature="0" /> + <path + id="path44" + d="M 68.695227,97.5874 67.705009,94.630892 66.714791,97.5874 Z" + style="fill:none;stroke:#000000;stroke-width:0.22633553px;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + inkscape:connector-curvature="0" /> + <path + id="path46" + d="m 98.93931,115.6801 v 11.54311 h 35.30834 V 115.6801 Z" + style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.26458332" + inkscape:connector-curvature="0" /> + <path + id="path48" + d="M 190.92381,167.8269 H 324.37266 V 124.19939 H 190.92381 Z" + clip-path="url(#clipEmfPath1)" + style="fill:none;stroke:#000000;stroke-width:0.26732543px;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + inkscape:connector-curvature="0" + transform="matrix(0.26458333,0,0,0.26458333,48.424052,82.819007)" /> + <text + id="text54" + y="120.65331" + x="108.20107" + style="font-style:normal;font-variant:normal;font-weight:400;font-size:2.94348955px;line-height:125%;font-family:Calibri;text-align:start;letter-spacing:0px;word-spacing:0px;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" + xml:space="preserve"><tspan + id="tspan52" + y="120.65331" + x="108.20107" + sodipodi:role="line" + style="stroke-width:0.26458332"><tspan + id="tspan50" + style="font-style:normal;font-variant:normal;font-weight:400;font-size:2.94348955px;font-family:Calibri;fill:#000000;stroke-width:0.26458332" + dy="0" + dx="0"><<interface>></tspan></tspan></text> + <text + id="text60" + y="124.27463" + x="104.90981" + style="font-style:normal;font-variant:normal;font-weight:400;font-size:2.94348955px;line-height:125%;font-family:Calibri;text-align:start;letter-spacing:0px;word-spacing:0px;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" + xml:space="preserve"><tspan + id="tspan58" + y="124.27463" + x="104.90981" + sodipodi:role="line" + style="stroke-width:0.26458332"><tspan + id="tspan56" + style="font-style:normal;font-variant:normal;font-weight:400;font-size:2.94348955px;font-family:Calibri;fill:#000000;stroke-width:0.26458332" + dy="0" + dx="0">TableReadFunction</tspan></tspan></text> + <path + id="path62" + d="m 98.93931,131.97625 v 11.54311 h 35.30834 v -11.54311 z" + style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.26458332" + inkscape:connector-curvature="0" /> + <path + id="path64" + d="m 190.92381,229.41867 h 133.44885 v -43.6275 H 190.92381 Z" + clip-path="url(#clipEmfPath1)" + style="fill:none;stroke:#000000;stroke-width:0.26732543px;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + inkscape:connector-curvature="0" + transform="matrix(0.26458333,0,0,0.26458333,48.424052,82.819007)" /> + <text + id="text70" + y="136.94946" + x="108.20107" + style="font-style:normal;font-variant:normal;font-weight:400;font-size:2.94348955px;line-height:125%;font-family:Calibri;text-align:start;letter-spacing:0px;word-spacing:0px;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" + xml:space="preserve"><tspan + id="tspan68" + y="136.94946" + x="108.20107" + sodipodi:role="line" + style="stroke-width:0.26458332"><tspan + id="tspan66" + style="font-style:normal;font-variant:normal;font-weight:400;font-size:2.94348955px;font-family:Calibri;fill:#000000;stroke-width:0.26458332" + dy="0" + dx="0"><<interface>></tspan></tspan></text> + <text + id="text76" + y="140.57079" + x="104.52448" + style="font-style:normal;font-variant:normal;font-weight:400;font-size:2.94348955px;line-height:125%;font-family:Calibri;text-align:start;letter-spacing:0px;word-spacing:0px;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" + xml:space="preserve"><tspan + id="tspan74" + y="140.57079" + x="104.52448" + sodipodi:role="line" + style="stroke-width:0.26458332"><tspan + id="tspan72" + style="font-style:normal;font-variant:normal;font-weight:400;font-size:2.94348955px;font-family:Calibri;fill:#000000;stroke-width:0.26458332" + dy="0" + dx="0">TableWriteFunction</tspan></tspan></text> + <path + id="path78" + d="m 86.943528,107.87152 h 5.205716 v 13.58013 h 6.790066" + style="fill:none;stroke:#000000;stroke-width:0.22633553px;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + inkscape:connector-curvature="0" /> + <path + id="path80" + d="m 88.527877,106.85301 -2.03702,1.01851 2.03702,1.01851 2.037019,-1.01851 z" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.26458332" + inkscape:connector-curvature="0" /> + <path + id="path82" + d="m 88.527877,106.85301 -2.03702,1.01851 2.03702,1.01851 2.037019,-1.01851 z" + style="fill:none;stroke:#000000;stroke-width:0.22633553px;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + inkscape:connector-curvature="0" /> + <path + id="path84" + d="m 86.943528,107.87152 h 5.205716 v 29.87629 h 6.790066" + style="fill:none;stroke:#000000;stroke-width:0.22633553px;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + inkscape:connector-curvature="0" /> + <path + id="path86" + d="m 88.527877,106.85301 -2.03702,1.01851 2.03702,1.01851 2.037019,-1.01851 z" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.26458332" + inkscape:connector-curvature="0" /> + <path + id="path88" + d="m 88.527877,106.85301 -2.03702,1.01851 2.03702,1.01851 2.037019,-1.01851 z" + style="fill:none;stroke:#000000;stroke-width:0.22633553px;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + inkscape:connector-curvature="0" /> + </g> +</svg> http://git-wip-us.apache.org/repos/asf/samza/blob/6c9715fb/docs/learn/documentation/versioned/api/table-api.md ---------------------------------------------------------------------- diff --git a/docs/learn/documentation/versioned/api/table-api.md b/docs/learn/documentation/versioned/api/table-api.md new file mode 100644 index 0000000..d95dfac --- /dev/null +++ b/docs/learn/documentation/versioned/api/table-api.md @@ -0,0 +1,558 @@ +--- +layout: page +title: Samza Table API +--- +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> + + +# Introduction + +Samza Table API is an abstraction for data sources that support random +access by key, which simplifies stream-table-join. It is the natural +evolution of the existing [storage API] (https://github.com/apache/samza/blob/master/samza-kv/src/main/scala/org/apache/samza/storage/kv/KeyValueStorageEngine.scala), +and it offers support for both local and remote data sources and +composition through hybrid tables. + +For various reasons, a real-time stream often only contain minimal or a +small amount of information, and may need to be augmented with richer +information fetched from adjunct data sources through joining. This is +quite common in advertising, relevance ranking, fraud detection, and +other domains. However, there exists a wide variety of data stores with +different characteristics and levels of sophistication. Samza Table API +simplifies the application developer experience by hiding the details of +individual technologies, while making it easier to migrate from one +technology to another. + +For remote data sources, the Samza remote table provides optimized access +such as caching, rate-limiting, retry and batching (future) support. + +In addition, more advanced functionalities can be provided through table +composition. For example, bootstrapping a stream is often used to build +an authoritative local cache, and today stream processing has to wait +until bootstrap is completed. A hybrid table can provide access to remote +data source while the local cache is being built, so that stream processing +could begin earlier. + +Application developers can now take advantage of the aforementioned benefits, +which are all encapsulated under the Samza Table API. + +# Sample Applications + +Sample applications demonstrating how to use Samza Table API can be found +[here] (https://github.com/apache/samza-hello-samza/tree/latest/src/main/java/samza/examples/cookbook). + +# Architecture and Concepts + +The diagram below illustrates the overall architecture of Samza Table API. + + + +Letâs look at a few concepts before diving into the API. + + + +[`Table`] (https://github.com/apache/samza/blob/master/samza-api/src/main/java/org/apache/samza/table/Table.java) - +This interface represents a dataset that can be accessed by key. We support +two types of tables: read-only and read-write. A table can be accessed either +synchronously or asynchronously and a request may contain one or more keys. +There are three broad categories of tables: local, remote and hybrid. + +[`ReadableTable`] (https://github.com/apache/samza/blob/master/samza-api/src/main/java/org/apache/samza/table/ReadableTable.java) - +Interface that represents a read-only table. It implements Table. + +[`ReadWriteTable`] (https://github.com/apache/samza/blob/master/samza-api/src/main/java/org/apache/samza/table/ReadWriteTable.java) - +Interface that represents a read-write table. It implements Table. + +[`TableDescriptor`] (https://github.com/apache/samza/blob/master/samza-api/src/main/java/org/apache/samza/operators/TableDescriptor.java) - +User-facing object that contains metadata that completely describes a table. +It may include identifier, serialization, provider, configuration, etc. +Example implementations of this interface are + +* [`RemoteTableDescriptor`] (https://github.com/apache/samza/blob/master/samza-core/src/main/java/org/apache/samza/table/remote/RemoteTableDescriptor.java) + facilitates access to remotely stored data, +* [`InMemoryTableDescriptor`] (https://github.com/apache/samza/blob/master/samza-kv-inmemory/src/main/java/org/apache/samza/storage/kv/inmemory/InMemoryTableDescriptor.java) + describes a table stored in-memory, and +* [`RocksDbTableDescriptor`] (https://github.com/apache/samza/blob/master/samza-kv-rocksdb/src/main/java/org/apache/samza/storage/kv/RocksDbTableDescriptor.java) + describes a table stored in RocksDB. + +# Table Sync and Async API + +Samza Table supports both synchronous and asynchronous API. Below is an example for +the **`get`** operation. + +{% highlight java %} + /** + * Gets the value associated with the specified {@code key}. + * + * @param key the key with which the associated value is to be fetched. + * @return if found, the value associated with the specified {@code key}; + * otherwise, {@code null}. + * @throws NullPointerException if the specified {@code key} is {@code null}. + */ + V get(K key); + + /** + * Asynchronously gets the value associated with the specified {@code key}. + * + * @param key the key with which the associated value is to be fetched. + * @return completableFuture for the requested value + * @throws NullPointerException if the specified {@code key} is {@code null}. + */ + CompletableFuture<V> getAsync(K key); +{% endhighlight %} + + +# Using Table with Samza High Level API + +The code snippet below illustrates the usage of table in Samza high level API. + +{% highlight java %} + 1 class SamzaStreamApplication implements StreamApplication { + 2 @Override + 3 public void describe(StreamApplicationDescriptor appDesc) { + 4 TableDescriptor<Integer, Profile> desc = new InMemoryTableDescriptor( + 5 "t1", KVSerde.of(new IntegerSerde(), new ProfileJsonSerde())); + 6 + 7 Table<KV<Integer, Profile>> table = appDesc.getTable(desc); + 8 + 9 appDesc.getInputStream("PageView", new NoOpSerde<PageView>()) +10 .map(new MyMapFunc()) +11 .join(table, new MyJoinFunc()) +12 .sendTo(anotherTable); +13 } +14 } +15 +16 static class MyMapFunc implements MapFunction<PageView, KV<Integer, PageView>> { +17 private ReadableTable<Integer, Profile> profileTable; +18 +19 @Override +20 public void init(Config config, TaskContext context) { +21 profileTable = (ReadableTable<Integer, Profile>) context.getTable("t1"); +22 } +23 +24 @Override +25 public KV<Integer, PageView> apply(PageView message) { +26 return new KV.of(message.getId(), message); +27 } +28 } +29 +30 static class MyJoinFunc implements StreamTableJoinFunction +31 <Integer, KV<Integer, PageView>, KV<Integer, Profile>, EnrichedPageView> { +32 +33 @Override +34 public EnrichedPageView apply(KV<Integer, PageView> m, KV<Integer, Profile> r) { +35 counterPerJoinFn.get(this.currentSeqNo).incrementAndGet(); +36 return r == null ? null : new EnrichedPageView( +37 m.getValue().getPageKey(), m.getKey(), r.getValue().getCompany()); +38 } +39 } +{% endhighlight %} + +In the code snippet above, we read from an input stream, perform transformation, +join with a table and finally write the output to another table. + +1. Line 4-5: A `TableDescriptor` for an in-memory table is created, and then + the serde is set. +2. Line 7: A table object is created from the `TableDescriptor`; internally, + the `TableDescriptor` is converted to a `TableSpec`, and registered with the + `TaskApplicationDescriptor`. The table object has a reference to the `TableSpec`. +3. Line 9: creates an `InputStream` +4. Line 10: applies a map operator defined in line 16-28, all table instances + can be accessed from the task context in `Task.init()`. In this example, + it is stored in a local variable. +5. Line 11: joins the mapped stream with the table using the supplied join + function defined in lines 30-39. +6. Line 12: writes the join result stream to another table + +# Using Table with Samza Low Level API + +The code snippet below illustrates the usage of table in Samza low level API. + +{% highlight java %} + 1 class SamzaTaskApplication implements TaskApplication { + 2 + 3 @Override + 4 public void describe(TaskApplicationDescriptor appDesc) { + 5 DelegatingSystemDescriptor ksd = new DelegatingSystemDescriptor("mySystem"); + 6 + 7 TableDescriptor<Integer, Profile> tableDesc = new InMemoryTableDescriptor( + 8 "T1", KVSerde.of(new IntegerSerde(), new ProfileJsonSerde())); + 9 GenericInputDescriptor<Profile> profileISD = ksd.getInputDescriptor("Profile", new NoOpSerde<>()); +10 +11 appDesc.addTable(tableDesc); +12 appDesc.addInputStream(profileISD); +13 } +14 +15 +16 public class MyStreamTask implements StreamTask, InitableTask { +17 private ReadWriteTable<Integer, Profile> profileTable; +18 +19 @Override +20 public void init(Config config, TaskContext context) { +21 profileTable = (ReadWriteTable<Integer, Profile>) context.getTable("t1"); +22 } +23 +24 @Override +25 public void process(IncomingMessageEnvelope envelope, MessageCollector collector, TaskCoordinator coordinator) { +26 String key = (String)message.getKey(); +27 Profile profile = (Profile)message.getMessage(); +28 profileTable.put(key, profile); +29 } +30 } +{% endhighlight %} + +In the code snippet above, we read from an input stream, perform transformation, +join with a table and finally write the output to another table. + +1. Line 7-8: A `TableDescriptor` for an in-memory table is created with tableId ât1â, + and then the serde is set. +2. Line 9: creates an `InputStreamDescriptor`. +3. Line 11-12: adds `TableDescriptor` and `InputStreamDescriptor` to the `TaskApplicationDescriptor`. +4. Line 16: `InitiableStreamTask` is implemented. +5. Line 21: A reference to table ât1â is obtained in the `Task.init()` method. +6. Line 26-28: gets the profile key and record from the incoming stream and writes to the table. + +[`ReadableTable`] (https://github.com/apache/samza/blob/master/samza-api/src/main/java/org/apache/samza/table/ReadableTable.java) +or [`ReadWriteTable`] (https://github.com/apache/samza/blob/master/samza-api/src/main/java/org/apache/samza/table/ReadWriteTable.java) +can be used in the +[`StreamTask.process()`] (https://github.com/apache/samza/blob/master/samza-api/src/main/java/org/apache/samza/task/StreamTask.java#L49) +method on the table reference obtained +in the +[`InitableTask.init()`] (https://github.com/apache/samza/blob/master/samza-api/src/main/java/org/apache/samza/task/InitableTask.java#L35) +method. + + +# Table Metrics + +The table below summarizes table metrics: + + +| Metrics | Class | Description | +|---------|-------|-------------| +|`get-ns`|`ReadableTable`|Average latency of `get/getAsync()` operations| +|`getAll-ns`|`ReadableTable`|Average latency of `getAll/getAllAsync()` operations| +|`num-gets`|`ReadableTable`|Count of `get/getAsync()` operations +|`num-getAlls`|`ReadableTable`|Count of `getAll/getAllAsync()` operations +|`put-ns`|`ReadWriteTable`|Average latency of `put/putAsync()` operations +|`putAll-ns`|`ReadWriteTable`|Average latency of `putAll/putAllAsync()` operations +|`num-puts`|`ReadWriteTable`|Count of `put/putAsync()` operations +|`num-putAlls`|`ReadWriteTable`|Count of `putAll/putAllAsync()` operations +|`delete-ns`|`ReadWriteTable`|Average latency of `delete/deleteAsync()` operations +|`deleteAll-ns`|`ReadWriteTable`|Average latency of `deleteAll/deleteAllAsync()` operations +|`delete-num`|`ReadWriteTable`|Count of `delete/deleteAsync()` operations +|`deleteAll-num`|`ReadWriteTable`|Count of `deleteAll/deleteAllAsync()` operations +|`flush-ns`|`ReadWriteTable`|Average latency of flush operations +|`flush-num`|`ReadWriteTable`|Count of flush operations +|`hit-rate`|`CachingTable`|Cache hit rate (%) +|`miss-rate`|`CachingTable`|Cache miss rate (%) +|`req-count`|`CachingTable`|Count of requests +|`retry-count`|`TableRetryPolicy`|Count of retries executed (excluding the first attempt) +|`success-count`|`TableRetryPolicy`|Count of successes at first attempt +|`perm-failure-count`|`TableRetryPolicy`|Count of operations that failed permanently and exhausted all retries +|`retry-timer`|`TableRetryPolicy`|Total time spent in each IO; this is updated only when at least one retry has been attempted. + + +# Table Types + +## Remote Table + +[`RemoteTable`](https://github.com/apache/samza/blob/master/samza-core/src/main/java/org/apache/samza/table/remote/RemoteTableDescriptor.java) +provides a unified abstraction for Samza applications to access any remote data +store through stream-table join in high-level API or direct access in low-level +API. Remote Table is a store-agnostic abstraction that can be customized to +access new types of stores by writing pluggable I/O "Read/Write" functions, +implementations of +[`TableReadFunction`](https://github.com/apache/samza/blob/master/samza-core/src/main/java/org/apache/samza/table/remote/TableReadFunction.java) and +[`TableWriteFunction`](https://github.com/apache/samza/blob/master/samza-core/src/main/java/org/apache/samza/table/remote/TableWriteFunction.java) +interfaces. Remote Table also provides common functionality, eg. rate limiting +(built-in) and caching (hybrid). + +The async APIs in Remote Table are recommended over the sync versions for higher +throughput. They can be used with Samza with low-level API to achieve the maximum +throughput. + +Remote Tables are represented by class +[`RemoteReadableTable`](https://github.com/apache/samza/blob/master/samza-core/src/main/java/org/apache/samza/table/remote/RemoteReadableTable.java) and +[`RemoteReadWriteTable`](https://github.com/apache/samza/blob/master/samza-core/src/main/java/org/apache/samza/table/remote/RemoteReadWriteTable.java). +All configuration options of a Remote Table can be found in the +[`RemoteTableDescriptor`](https://github.com/apache/samza/blob/master/samza-core/src/main/java/org/apache/samza/table/remote/RemoteTableDescriptor.java) class. + +### Rate Limiting + +Remote Table has built-in client-side rate limiting support in both of its sync +and async executions. This is useful when a remote data store does not have +server-side rate limiting or is not sophisticated enough to handle heavy +inbound requests. + +#### Configuration + +Rate limiting can be enabled with [`RemoteTableDescriptor`](https://github.com/apache/samza/blob/master/samza-core/src/main/java/org/apache/samza/table/remote/RemoteTableDescriptor.java) in two ways: + +1. Default: `withReadRateLimit()` and `withWriteRateLimit()`. The + [default implementation](https://github.com/apache/samza/blob/master/samza-core/src/main/java/org/apache/samza/util/EmbeddedTaggedRateLimiter.java) + uses [Guava](https://google.github.io/guava/releases/snapshot-jre/api/docs/com/google/common/util/concurrent/RateLimiter.html) + for rate limiting and provides basic throttling on read/write rates. +2. User-defined instance: `withRateLimiter()`. Tailored for more advanced + usages, eg. custom policies and/or rate limiter libraries + +#### Quota + +For the default rate limiter, a per-container quota needs to be specified, and +is divided evenly among all task instances. Application developers are expected +to calculate such quota from a global quota against the number of containers. + +### Retry + +I/O failures are not uncommon given the inherently unreliable network and complex +behaviors of distributed data stores. To be fault-tolerant, Remote Table provides +built-in support for retrying failed I/O operations originated from the data store +clients. + +Retry capability can be added to a [`RemoteTableDescriptor`](https://github.com/apache/samza/blob/master/samza-core/src/main/java/org/apache/samza/table/remote/RemoteTableDescriptor.java) by providing a +[`TableRetryPolicy`] (https://github.com/apache/samza/blob/master/samza-core/src/main/java/org/apache/samza/table/retry/TableRetryPolicy.java), + which consists of three aspects: + +* Backoff/Sleep policy - fixed, random, exponential with jitters +* Termination policy - by total attempts and/or delay +* Retriable exception classification - predicate on `Throwable` + +By default, retry is disabled as such failed I/O operations will propagate up and +the caller is expected to handle the exception. When enabled, retry is on a +per-request basis such that each individual request is retried independently. + +Lastly, Remote Table retry provides a set of standard metrics for monitoring. +They can be found in +[`RetryMetrics`] (https://github.com/apache/samza/blob/master/samza-core/src/main/java/org/apache/samza/table/retry/RetryMetrics.java). + +## Local Table + +A table is considered local when its data physically co-exists on the same host +machine as its running job, e.g. in memory or on disk. Local tables are particularly +useful when data needs to be accessed frequently with low latency, such as a cache. +Samza Table API supports in-memory and RocksDB-based local tables, which are based +on the current implementation of in-memory and RocksDB stores. Both tables provide +feature parity to existing in-memory and RocksDB-based stores. For more detailed +information please refer to +[`RocksDbTableDescriptor`] (https://github.com/apache/samza/blob/master/samza-kv-rocksdb/src/main/java/org/apache/samza/storage/kv/RocksDbTableDescriptor.java) and +[`InMemoryTableDescriptor`] (https://github.com/apache/samza/blob/master/samza-kv-inmemory/src/main/java/org/apache/samza/storage/kv/inmemory/InMemoryTableDescriptor.java). + +## Hybrid Table + +Hybrid Table consists of one or more tables, and it orchestrates operations between +them to achieve more advanced functionality. Caching support for remote table is +currently built on top of hybrid Table because cache can be naturally abstracted +as a table, eg. local table is also a durable cache. + +### Caching + +Despite the convenience of remote table, it still incurs the same latency as accessing +the remote store directly. Whenever eventual consistency is acceptable, Samza +applications can leverage the caching support in Table API to reduce such latency +in addition to using the async methods. + +[`CachingTable`] (https://github.com/apache/samza/blob/master/samza-core/src/main/java/org/apache/samza/table/caching/CachingTable.java) +is the generic table type for combining a cache table (Guava, RocksDb, Couchbase) +with a remote table. Both the cache and data tables are pluggable, and `CachingTable` +handles the interactions between them for caching semantics. + +#### Write Policies + +Caching Table supports below write policies and you can configure them with +[`CachingTableDescriptor`] (https://github.com/apache/samza/blob/master/samza-core/src/main/java/org/apache/samza/table/caching/CachingTableDescriptor.java). + +* Write-through: records are written to both the data store and cache +* Write-around: records are written only to data store bypassing the cache + * Useful when read-path has no locality with read-path + +#### Synchronization + +No synchronization is done between data store and cache in `CachingTable` because +it is very cumbersome in the async code paths. Given eventual consistency is a +presumed trade-off for enabling caching, it should be acceptable for the table +and cache to not always be in-sync. Last but not least, unsynchronized operations +in `CachingTable` deliver much higher throughput. + +#### Configuration + +Similar to +[`RateLimiter`](https://github.com/apache/samza/blob/master/samza-api/src/main/java/org/apache/samza/util/RateLimiter.java) +configuration in remote table, caching can be configured in two ways: + +1. Default: `withCacheSize()`, `withReadTtl()`, `withWriteTtl()` +2. Custom `CacheTable` instance: `withCache()` + +The default +[`CacheTable`] (https://github.com/apache/samza/blob/master/samza-core/src/main/java/org/apache/samza/table/caching/guava/GuavaCacheTable.java) +is an in-memory cache implemented on top of +[Guava Cache] (https://github.com/google/guava/wiki/CachesExplained). + +# Implementing Your Own Tables + +## More Concepts + +[`TableSpec`] (https://github.com/apache/samza/blob/master/samza-api/src/main/java/org/apache/samza/table/TableSpec.java) +- Internal representation of a table, containing all information about a table. + +[`TableProvider`] (https://github.com/apache/samza/blob/master/samza-api/src/main/java/org/apache/samza/table/TableProvider.java) +- Provides the underlying table implementation that conforms to Table API. + +[`TableManager`] (https://github.com/apache/samza/blob/master/samza-core/src/main/java/org/apache/samza/table/TableManager.java) +- Responsible for lifecycle of all table instances within a task; it is +created during instantiation of Samza container. + +## Lifecycle of a Table + +The life of a table goes through a few phases + +1. **Declaration** - at first one declares the table by creating a `TableDescriptor`. In both + Samza high level and low level API, the `TableDescriptor` is registered with stream + graph, internally converted to `TableSpec` and in return a reference to a `Table` + object is obtained that can participate in the building of the DAG. +2. **Instantiation** - during planning stage, configuration is + [generated] (https://github.com/apache/samza/blob/master/samza-core/src/main/java/org/apache/samza/execution/JobNode.java) + from `TableSpec`, + and the actual tables are instantiated during initialization of + [Samza container] (https://github.com/apache/samza/blob/master/samza-core/src/main/scala/org/apache/samza/container/SamzaContainer.scala). +3. **Usage** - there are a few ways to access a table instance + * In Samza high level API, a reference to Table can be obtained from a `TableDescriptor`, + which can be used to participate in the DAG operations such as + [`join()`] (https://github.com/apache/samza/blob/master/samza-api/src/main/java/org/apache/samza/operators/MessageStream.java) and + [`sendTo()`] (https://github.com/apache/samza/blob/master/samza-api/src/main/java/org/apache/samza/operators/MessageStream.java) + * In Samza high level API, all table instances can be retrieved from `TaskContext` using + table-id during initialization of a + [`InitableFunction`] (https://github.com/apache/samza/blob/master/samza-api/src/main/java/org/apache/samza/operators/functions/InitableFunction.java). + * In Samza low level API, all table instances can be retrieved from `TaskContext` using + table-id during initialization of a + [`InitableTask`] (https://github.com/apache/samza/blob/master/samza-api/src/main/java/org/apache/samza/task/InitableTask.java). +4. **Cleanup** - + [`close()`] (https://github.com/apache/samza/blob/master/samza-api/src/main/java/org/apache/samza/table/ReadableTable.java) + is invoked on all tables when a job is stopped. + +## Developing a Local Table + +Developing a local table involves implementing a new table descriptor, provider and provider factory. + +1. [`TableDescriptor`] (https://github.com/apache/samza/blob/master/samza-api/src/main/java/org/apache/samza/operators/TableDescriptor.java) - this is the user facing object that contains primarily configuration parameters. + In addition, a few internal methods need to be implemented + * `generateTableSpecConfig()` should convert parameters in the table descriptor + to a `Map<String, String>`, so that information about a table can be transferred + to a `TableSpec`. + * `getTableSpec()` creates a `TableSpec` object, which is the internal representation + of a table. +2. [`TableProvider`] (https://github.com/apache/samza/blob/master/samza-api/src/main/java/org/apache/samza/table/TableProvider.java) - provides the implementation for a table. It ensures a table is + properly constructed and also manages its lifecycle. Methods to implement are + * `generateConfig()` generates all Samza configuration relevant to the table. + Note in the case of RocksDB, store configuration is also generated here. + +Note: + +* Since the current local table implementation relies on Samza store implementation, + adding a local table requires providing the store implementation first. + +## Developing a Remote Table + +The generic design of remote table abstracts away mach common functionality. +Therefore, adding a new remote table type is much more straightforward than +writing a Samza table from scratch. You only need to implement the +[`TableReadFunction`](https://github.com/apache/samza/blob/master/samza-core/src/main/java/org/apache/samza/table/remote/TableReadFunction.java) and +[`TableWriteFunction`](https://github.com/apache/samza/blob/master/samza-core/src/main/java/org/apache/samza/table/remote/TableWriteFunction.java) +(if supported) interfaces, and the new table type is readily usable with the +Remote Table framework. + + + +Since the interfaces have sufficient javadocs and are self-explanatory, we present a +high-level guideline to call out some less obvious aspects and help ensure consistency +among future I/O (Read/Write) function implementations in the following sections. + +### Serializability + +Samza Remote Table I/O function interfaces extend `java.io.Serializable`, which imposes +a serializability expectation on their implementations, i.e. + +1. All fields within I/O function classes must be serializable. +2. Non-serializable fields must be marked transient. Otherwise, serialization + of I/O function will fail. Typical examples of such fields are store client + objects. +3. Consequently, non-serializable fields must be initialized within the + implementation of the init() method of the InitableFunction interface extended + by both TableReadFunction and TableWriteFunction interfaces. Otherwise, + non-serializable fields will be null after I/O function is deserialized. + +{% highlight java %} +class ReadFunction implements TableReadFunction { + @Override + public void init(Config config, TaskContext context) { + /* Initialize all transient fields here. */ + } +} + +class WriteFunction implements TableWriteFunction { + @Override + public void init(Config config, TaskContext context) { + /* Initialize all transient fields here. */ + } +} +{% endhighlight %} + +### Logging + +Our recommendation is to: + +1. Avoid doing any informational logging in I/O functions that are typically + invoked extensively in Samza applications, e.g. + * `TableReadFunction.get[All]()` + * `TableWriteFunction.put[All]()` + * `TableWriteFunction.delete[All]()` +2. Log all initialization-related successes/failures occurring in overrides of +`InitableFunction.init()` to improve diagnosability. + +### Handling Client Exceptions and Retrying Failed Requests + +Implementations of I/O functions for remote stores are likely to utilize a +client object for communicating with their corresponding store endpoints. +In this setup, it is possible for an I/O function to run into situations +where the client it uses throws, e.g. in response to networking or logical +errors. + +We recommend: + +1. Catching all such errors, wrapping and throwing them in a +[`SamzaException`] (https://github.com/apache/samza/blob/master/samza-api/src/main/java/org/apache/samza/SamzaException.java). +2. Attempting no retry in the face of client errors or failed requests. The + intent of the current design of Samza Remote Table API is to handle + retries at a higher and more abstract Remote Table level, which implies + retrying is not a responsibility of I/O functions. + +### Caching + +Samza Remote Table API can be configured to utilize user-supplied caches. +You may refer to the [Caching](#caching) section under Hybrid Table for more details. + +### Rate Limiting +Samza Remote Table API offers generic rate limiting capabilities that can +be used with all I/O function implementations. You may refer to the +[Rate Limiting](#rate-limiting) section under Remote Table for more details. + +### Separate vs Combined Read/Write Implementations + +It is up to the developer whether to implement both `TableReadFunction` and +`TableWriteFunction` in one class or two separate classes. Defining them in +separate classes can be cleaner if their implementations are elaborate and +extended, whereas keeping them in a single class may be more practical if +they share a considerable amount of code or are relatively short. http://git-wip-us.apache.org/repos/asf/samza/blob/6c9715fb/docs/learn/documentation/versioned/index.html ---------------------------------------------------------------------- diff --git a/docs/learn/documentation/versioned/index.html b/docs/learn/documentation/versioned/index.html index 193297c..b37b616 100644 --- a/docs/learn/documentation/versioned/index.html +++ b/docs/learn/documentation/versioned/index.html @@ -28,6 +28,7 @@ title: Documentation <ul class="documentation-list"> <li><a href="comparisons/introduction.html">Low-level API</a></li> <li><a href="comparisons/mupd8.html">Streams DSL</a></li> + <li><a href="api/table-api.html">Table API</a></li> <li><a href="comparisons/storm.html">Samza SQL</a></li> <li><a href="comparisons/spark-streaming.html">Apache BEAM</a></li> <!-- TODO comparisons pages
