Skip to content
This repository has been archived by the owner on May 17, 2019. It is now read-only.

can't understand Parameter:deep_copy in Plugin:out_copy #268

Open
LmYjQ opened this issue May 2, 2017 · 1 comment
Open

can't understand Parameter:deep_copy in Plugin:out_copy #268

LmYjQ opened this issue May 2, 2017 · 1 comment

Comments

@LmYjQ
Copy link

LmYjQ commented May 2, 2017

I know the meaning of deep copy. but what does it mean in this scenario?
For example, I have two output as it is in the documentation:

<match myevent.file_and_mongo>
  @type copy
  <store>
    @type file
    path /var/log/fluent/myapp
    time_slice_format %Y%m%d
    time_slice_wait 10m
    time_format %Y%m%dT%H%M%S%z
    compress gzip
    utc
  </store>
  <store>
    @type mongo
    host fluentd
    port 27017
    database fluentd
    collection test
  </store>
</match>

If I had my filepath in localhost, and mongo in another host, is it a " inherent deep copy" which I could ignore the deep_copy parameter?

@cosmo0920
Copy link
Contributor

cosmo0920 commented Jan 4, 2018

When you use deep_copy parameter, out_copy will uses deep copy behavior on each record.
By default, out_copy uses shallow copy behavior which will be lower memory consumption but references "same instance or variable".

If you want to manipulate for each "copied record" after out_copy pipeline, you must use deep_copy parameter.
ref: https://www.cs.utexas.edu/~scottm/cs307/handouts/deepCopying.htm

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants