cancel
Showing results for 
Search instead for 
Did you mean: 

how can toolkit_file_csv_input use a directory relative to the project

Former Member
0 Kudos

The deprecated csv_in adapter could use a dir setting like ../../exampledata or ../data, so that you wouldn't need to have the entire path.  This would make the project easily portable.

I can't seem to do this with toolkit_file_csv_input, and all the studio examples are still using the deprecated adapters.  I am not interested in the non-managed invocation.


I don't get any error.



2014-09-26 15:43:22.856 | 13616 | container | [SP-3-150004] (0.527) sp(10836) Connection(standingdata_in/standingdata):: http://localhost:9786

2014-09-26 15:43:22.856 | 13616 | container | [SP-3-150004] (0.527) sp(10836) Connection(standingdata_in/standingdata):: esp://localhost:9786/default/algostrategies3

2014-09-26 15:43:22.856 | 13616 | container | [SP-3-150004] (0.527) sp(10836) Connection(standingdata_in/standingdata):: standingdata

2014-09-26 15:43:22.859 | 17580 | container | [SP-3-150004] (0.530) sp(10836) Connection(baskets_in/baskets):: http://localhost:9786

2014-09-26 15:43:22.859 | 17580 | container | [SP-3-150004] (0.530) sp(10836) Connection(baskets_in/baskets):: esp://localhost:9786/default/algostrategies3

2014-09-26 15:43:22.859 | 17580 | container | [SP-3-150004] (0.530) sp(10836) Connection(baskets_in/baskets):: baskets

How do I use a relative directory with the toolkit_file_csv_input adapter (managed).

Or I should use the deprecated adapters?

Accepted Solutions (1)

Accepted Solutions (1)

former_member217348
Participant
0 Kudos

Hi David,

 

To make an adapter’s properties for the project be configurable/portable, use the project's CCR
file to set any or all properties for the particular adapter you are configuring.

So, for example, I used ESP Studio to take the (unmanaged) example provided for the toolkit_file_csv_input adapter and changed the project so that it uses a managed csv input adapter.

Here's how I did it:

 

  1. Set up a new project that will be called “file_csv_input_managed”:
    • copy C:/sybase/ESP-5_1/adapters/framework/instances/file_csv_input
      to C:/sybase/ESP-5_1/adapters/framework/instances/file_csv_input_managed
  2. Open the new project in Studio:
    1. File->Open->ESP Project
    2. For Select root directory,
      browse to C:/sybase/ESP-5_1/adapters/framework/instances/file_csv_input_managed,
      click OK, and if you want to, check the checkbox Copy project into workspace,
      click Finish.
    3. In the Project Explorer, expand the file_csv_input_managed project folder.
    4. In the folder, right-click on model.ccl, choose Rename, change the name to file_csv_input_managed.ccl, click OK.
    5. In the folder, right-click on file_csv_input_managed.ccl, choose Open.
    6. Click to change focus to the file_csv_input_managed.ccl that is now open in the Authoring Perspective.
    7. Click on the Switch to Visual icon (or use F6)
    8. Add a File Hadoop CSV Input adapter to the visual diagram of the project
    9. Edit the adapter’s properties:
      • in the Basic tab:
        1. set the Stream name, opcode expected to FALSE
        2. set the Directory to C:/sybase/ESP-5_1/adapters/framework/instances/file_csv_input_managed/data
        3. set the File to input.csv
        4. click OK
    10. Connect the adapter to the BaseInput window.
    11. Save the project.
  3. Create a new CCR Project Configuration:
    1. File->New->CCR Project Configuration…, set File name to file_csv_input_managed, click Finish
  4. You should now be in the Authoring Perspective with the CCR file open for editing:
    1. Click on the Adapter Properties tab
    2. Click on Add from CCL – this will set up the property set for the File/Hadoop CSV Input based on the adapter properties in the CCL file.
    3. Save the CCR file
  5. Go back into the visual diagram of the project
    1. edit the adapter’s properties
    2. select Usenamedpropertyset
    3. choose File/Hadoop CSV Input from the dropdown so that the project will use the property set we just finished setting up in the CCR file
    4. delete/eliminate all the values that are in the Basic tab - the adapter will not need these to be in the CCL file since it is using the settings that are in the CCR file
    5. click OK
  6. Save the diagram
  7. You should now be able to successfully run the project from Studio and open a streamview to see that the csv data is input into the BaseInput window.
  8. View the frameworkadapter.log for any adapter errors – since you are running the project in the Studio's (local) cluster, the log file is located in <your ESP studio workspace directory>\projects\default.file_csv_input_managed.0\logs

Give it a try

Thanks,

Alice

Former Member
0 Kudos

Thanks Alice,

Is there a way I can mark this as correct answer?

former_member217348
Participant
0 Kudos

Hi David,

Yes, I believe that there is a way, though I am not able to see these myself (I assume because it is available only to non-SAP employees).

I went to the Getting Started link that I found in the upper right hand corner of the page:

On the Getting Started page, I found

On the page, it says:

Message Replies

You can reply to discussion threads and comment on blog posts and documents. Simply click Reply or Comment.

  • Message replies on discussion threads can be marked as "helpful" or correct." This is important in helping others identify the right answers and closing open threads.
  • Comments and messages can be "liked" if members find them useful.

Hope that helps,

Alice

Answers (0)