Show TOC

Sample Configuration File: File/Hadoop Event XML Input AdapterLocate this document in the navigation structure

Sample adapter configuration file for the File/Hadoop Event XML Input adapter.

<?xml version="1.0" encoding="utf-8"?>
<Adapter>
  <Name>File/Hadoop Event XML Input</Name>
  <Description>An adapter which gets xml data from files on the local file system or Hadoop Distributed File System, transforms it to ESP data format and publishes to a stream.</Description>
  <Log4jProperty>./log4j.properties</Log4jProperty>
  <CharsetName>US-ASCII</CharsetName>
  <Cipher>
		<File>../../adapter.key</File>
  </Cipher>
  <Modules>
    <Module type="transporter">
      <InstanceName>FileInputTransporter</InstanceName>
      <Name>FileInputTransporter</Name>
      <Next>XmlListInputFormatter</Next>
      <BufferMaxSize>10240</BufferMaxSize>
      <Parameters>
          <FileInputTransporterParameters>
              <Dir>./data</Dir>
              <File>input.xml</File>
              <AccessMode>rowBased</AccessMode>
              <RemoveAfterProcess>false</RemoveAfterProcess>
              <ScanDepth>5</ScanDepth>
          </FileInputTransporterParameters>
      </Parameters>
    </Module>

    <Module type="formatter">
      <InstanceName>XmlListInputFormatter</InstanceName>
      <Name>XmlStringToEspFormatter</Name>
      <Next>MyInStream_Publisher</Next>
      <Parallel>true</Parallel>
      <Parameters>
      </Parameters>
    </Module>

    <Module type="espconnector">
      <InstanceName>MyInStream_Publisher</InstanceName>
      <Name>EspPublisher</Name>
      <Parameters>
        <EspPublisherParameters>
		  <!--Uncomment the following 2 elements when you use 'start_adapter[.bat|.sh]' -->
          <!--ProjectName>EspProject1</ProjectName-->
          <!--StreamName>BaseInput</StreamName-->
          <MaxPubPoolSize>1</MaxPubPoolSize>
          <UseTransactions>false</UseTransactions>
          <SafeOps>false</SafeOps>
          <SkipDels>false</SkipDels>
        </EspPublisherParameters>
      </Parameters>
      <BufferMaxSize>10240</BufferMaxSize>
    </Module>

  </Modules>

  <EspProjects>
    <EspProject>
      <Name>EspProject1</Name>
      <Uri>esp[s]://localhost:19011/sample_workspace/file_xmllist_input</Uri>
      
      <Security>
        <User></User>
        <Password encrypted="false"></Password>
        <AuthType>user_password</AuthType>
      </Security>
    </EspProject>
  </EspProjects>
  <GlobalParameters></GlobalParameters>
</Adapter>
Here is a sample input file which contains a stream name and opcode value:
<BaseInput ESP_OPS="i" stringCol="aaa" int32Col="11" int64Col="111" doubleCol="1.1" dateCol="2008-03-13T08:19:30" moneyCol="111.1111" timestampCol="2008-03-13T08:19:30.123" booleanCol="false" binaryCol="FF00FE05FF" bigdatetimeCol="2008-03-13T08:19:30.123456" intervalCol="64000" money1Col="922.0" money15Col="337.000000000000000" />
<BaseInput ESP_OPS="u" stringCol="new" int32Col="22" int64Col="222" doubleCol="2.2" dateCol="2008-03-13T08:19:30" moneyCol="222.2222" timestampCol="2008-03-13T08:19:30.123" booleanCol="true" binaryCol="FF00FE05FF" bigdatetimeCol="2008-03-13T08:19:30.123456" intervalCol="64000" money1Col="922.0" money15Col="337.000000000000000" />
<BaseInput ESP_OPS="i" stringCol="bbb" int32Col="33" int64Col="333" doubleCol="3.3" dateCol="2008-03-13T08:19:30" moneyCol="111.1111" timestampCol="2008-03-13T08:19:30.123" booleanCol="true" binaryCol="FF00FE05FF" bigdatetimeCol="2008-03-13T08:19:30.123456" intervalCol="64000" money1Col="922.0" money15Col="337.000000000000000" />
<BaseInput ESP_OPS="d" stringCol="bbb" int32Col="33" int64Col="333" doubleCol="3.3" dateCol="2008-03-13T08:19:30" moneyCol="111.1111" timestampCol="2008-03-13T08:19:30.123" booleanCol="true" binaryCol="FF00FE05FF" bigdatetimeCol="2008-03-13T08:19:30.123456" intervalCol="64000" money1Col="922.0" money15Col="337.000000000000000" />
The accepted opcodes are:
  • i or I: INSERT
  • d or D: DELETE
  • u or U: UPDATE
  • p or P: UPSERT
  • s or S: SAFEDELETE
Here is a sample input file which does not specify an opcode value. By default, the opcode UPSERT is used.
<BaseInput stringCol="aaa" int32Col="11" int64Col="111" doubleCol="1.1"
    dateCol="2008-03-13T08:19:30" moneyCol="111.1111"  timestampCol="2008-03-13T08:19:30.123"
    booleanCol="false" binaryCol="FF00FE05FF"  bigdatetimeCol="2008-03-13T08:19:30.123456"
    intervalCol="64000"  money1Col="922.0" money15Col="337.000000000000000" /><BaseInput
    stringCol="new" int32Col="22" int64Col="222" doubleCol="2.2"
    dateCol="2008-03-13T08:19:30" moneyCol="222.2222"  timestampCol="2008-03-13T08:19:30.123"
    booleanCol="true" binaryCol="FF00FE05FF"  bigdatetimeCol="2008-03-13T08:19:30.123456"
    intervalCol="64000"  money1Col="922.0" money15Col="337.000000000000000" /><BaseInput
    stringCol="bbb" int32Col="33" int64Col="333" doubleCol="3.3"
    dateCol="2008-03-13T08:19:30" moneyCol="111.1111"  timestampCol="2008-03-13T08:19:30.123"
    booleanCol="true" binaryCol="FF00FE05FF"  bigdatetimeCol="2008-03-13T08:19:30.123456"
    intervalCol="64000"  money1Col="922.0" money15Col="337.000000000000000" />