<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Extracting state from GenerateTableFetch processor in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Extracting-state-from-GenerateTableFetch-processor/m-p/350989#M236109</link>
    <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/99088"&gt;@nk20&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can use the NiFi API to extract the current state of any stateful processor if you need this.&lt;/P&gt;&lt;P&gt;See the example below for a PutFile processor:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;access_token=$(curl -k \
  -X POST \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -d 'username=admin&amp;amp;password=supersecret1'
  "https://localhost:8443/nifi-api/access/token")

curl -k \
  -H "Authorization: Bearer $access_token" \
  "https://localhost:8443/nifi-api/processors/dd24aaec-0182-1000-ffff-ffff9f128d94/state"

{
  "componentState": {
    "componentId": "dd24aaec-0182-1000-ffff-ffff9f128d94",
    "stateDescription": "After performing a listing of files, the timestamp of the newest file is stored. This allows the Processor to list only files that have been added or modified after this date the next time that the Processor is run. Whether the state is stored with a Local or Cluster scope depends on the value of the &amp;lt;Input Directory Location&amp;gt; property.",
    "clusterState": {
      "scope": "CLUSTER",
      "totalEntryCount": 0,
      "state": []
    },
    "localState": {
      "scope": "LOCAL",
      "totalEntryCount": 6,
      "state": [
        {
          "key": "id.0",
          "value": "/tmp/hsperfdata_nifi/129",
          "clusterNodeId": "420e540a-ccd6-4e7c-bc25-c572f503b338",
          "clusterNodeAddress": "nifi1:8443"
        },
        {
          "key": "id.0",
          "value": "/tmp/hsperfdata_nifi/130",
          "clusterNodeId": "00e23669-130f-4e12-8a26-be3ab95923d4",
          "clusterNodeAddress": "nifi0:8443"
        },
        {
          "key": "listing.timestamp",
          "value": "1661567544049",
          "clusterNodeId": "420e540a-ccd6-4e7c-bc25-c572f503b338",
          "clusterNodeAddress": "nifi1:8443"
        },
        {
          "key": "listing.timestamp",
          "value": "1661567541525",
          "clusterNodeId": "00e23669-130f-4e12-8a26-be3ab95923d4",
          "clusterNodeAddress": "nifi0:8443"
        },
        {
          "key": "processed.timestamp",
          "value": "1661567544049",
          "clusterNodeId": "420e540a-ccd6-4e7c-bc25-c572f503b338",
          "clusterNodeAddress": "nifi1:8443"
        },
        {
          "key": "processed.timestamp",
          "value": "1661567541525",
          "clusterNodeId": "00e23669-130f-4e12-8a26-be3ab95923d4",
          "clusterNodeAddress": "nifi0:8443"
        }
      ]
    }
  }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;André&lt;/P&gt;</description>
    <pubDate>Sat, 27 Aug 2022 02:42:42 GMT</pubDate>
    <dc:creator>araujo</dc:creator>
    <dc:date>2022-08-27T02:42:42Z</dc:date>
    <item>
      <title>Extracting state from GenerateTableFetch processor</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Extracting-state-from-GenerateTableFetch-processor/m-p/350840#M236090</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We are migrating data from one db to another using NIFI. We are using GenerateTableFetch processor for the incremental fetch by setting a column in Max-Value columns. For logging purpose, i need to extract the state of the GenerateTableFetch&amp;nbsp; processor and insert in a table. By state I mean the max value of the 'Max-Value column' that is captured as the state of the processor. Can someone please help with how can i extract the processor state?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Aug 2022 01:31:15 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Extracting-state-from-GenerateTableFetch-processor/m-p/350840#M236090</guid>
      <dc:creator>nk20</dc:creator>
      <dc:date>2022-08-26T01:31:15Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting state from GenerateTableFetch processor</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Extracting-state-from-GenerateTableFetch-processor/m-p/350905#M236104</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is not every record you pull through the GenerateTableFetch will have the max value for the max column?&lt;/P&gt;</description>
      <pubDate>Fri, 26 Aug 2022 16:00:02 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Extracting-state-from-GenerateTableFetch-processor/m-p/350905#M236104</guid>
      <dc:creator>SAMSAL</dc:creator>
      <dc:date>2022-08-26T16:00:02Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting state from GenerateTableFetch processor</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Extracting-state-from-GenerateTableFetch-processor/m-p/350989#M236109</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/99088"&gt;@nk20&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can use the NiFi API to extract the current state of any stateful processor if you need this.&lt;/P&gt;&lt;P&gt;See the example below for a PutFile processor:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;access_token=$(curl -k \
  -X POST \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -d 'username=admin&amp;amp;password=supersecret1'
  "https://localhost:8443/nifi-api/access/token")

curl -k \
  -H "Authorization: Bearer $access_token" \
  "https://localhost:8443/nifi-api/processors/dd24aaec-0182-1000-ffff-ffff9f128d94/state"

{
  "componentState": {
    "componentId": "dd24aaec-0182-1000-ffff-ffff9f128d94",
    "stateDescription": "After performing a listing of files, the timestamp of the newest file is stored. This allows the Processor to list only files that have been added or modified after this date the next time that the Processor is run. Whether the state is stored with a Local or Cluster scope depends on the value of the &amp;lt;Input Directory Location&amp;gt; property.",
    "clusterState": {
      "scope": "CLUSTER",
      "totalEntryCount": 0,
      "state": []
    },
    "localState": {
      "scope": "LOCAL",
      "totalEntryCount": 6,
      "state": [
        {
          "key": "id.0",
          "value": "/tmp/hsperfdata_nifi/129",
          "clusterNodeId": "420e540a-ccd6-4e7c-bc25-c572f503b338",
          "clusterNodeAddress": "nifi1:8443"
        },
        {
          "key": "id.0",
          "value": "/tmp/hsperfdata_nifi/130",
          "clusterNodeId": "00e23669-130f-4e12-8a26-be3ab95923d4",
          "clusterNodeAddress": "nifi0:8443"
        },
        {
          "key": "listing.timestamp",
          "value": "1661567544049",
          "clusterNodeId": "420e540a-ccd6-4e7c-bc25-c572f503b338",
          "clusterNodeAddress": "nifi1:8443"
        },
        {
          "key": "listing.timestamp",
          "value": "1661567541525",
          "clusterNodeId": "00e23669-130f-4e12-8a26-be3ab95923d4",
          "clusterNodeAddress": "nifi0:8443"
        },
        {
          "key": "processed.timestamp",
          "value": "1661567544049",
          "clusterNodeId": "420e540a-ccd6-4e7c-bc25-c572f503b338",
          "clusterNodeAddress": "nifi1:8443"
        },
        {
          "key": "processed.timestamp",
          "value": "1661567541525",
          "clusterNodeId": "00e23669-130f-4e12-8a26-be3ab95923d4",
          "clusterNodeAddress": "nifi0:8443"
        }
      ]
    }
  }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;André&lt;/P&gt;</description>
      <pubDate>Sat, 27 Aug 2022 02:42:42 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Extracting-state-from-GenerateTableFetch-processor/m-p/350989#M236109</guid>
      <dc:creator>araujo</dc:creator>
      <dc:date>2022-08-27T02:42:42Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting state from GenerateTableFetch processor</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Extracting-state-from-GenerateTableFetch-processor/m-p/351475#M236275</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/11191"&gt;@araujo&lt;/a&gt;&amp;nbsp;Thank you for the help.. It works.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 04 Sep 2022 23:19:57 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Extracting-state-from-GenerateTableFetch-processor/m-p/351475#M236275</guid>
      <dc:creator>nk20</dc:creator>
      <dc:date>2022-09-04T23:19:57Z</dc:date>
    </item>
  </channel>
</rss>

