muyangye opened a new pull request, #2430:
URL: https://github.com/apache/streampipes/pull/2430
<!--
~ 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.
~
-->
<!--
Thanks for contributing! Here are some tips you can follow to help us
incorporate your contribution quickly and easily:
1. If this is your first time, please read our contributor guidelines:
- https://streampipes.apache.org/getinvolved.html
- https://cwiki.apache.org/confluence/display/STREAMPIPES/Getting+Started
2. Make sure the PR title is formatted like: `[#<GitHub issue id>] PR title
...`
3. If the PR is unfinished, add '[WIP]' in your PR title, e.g.,
`[WIP][#<GitHub issue id>] PR title ...`.
4. Please write your PR title to summarize what this PR proposes/fixes.
5. Link the PR to the corresponding GitHub issue (if present) in the
`Development` section in the right menu bar.
6. Be sure to keep the PR description updated to reflect all changes.
7. If possible, provide a concise example to reproduce the issue for a
faster review.
8. Make sure tests pass via `mvn clean install`.
9. (Optional) If the contribution is large, please file an Apache ICLA
- http://apache.org/licenses/icla.pdf
-->
### Purpose
See #2181, finally merging internalFilename and originalFilename to one.
<!--
Please clarify what changes you are proposing and describe how those changes
will address the issue.
Furthermore, describe potential consequences the changes might have.
-->
### Remarks
Result:
I created 3 files with the same name using StreamPipes 0.93.0 release:

After which I run the latest migration which is successful:

However, for **pipelines, specifically Data Lake (not adapters, adapters can
produce messages as usual (i.e. if I create another pipeline using the same
adapter created in v0.93.0, I can still visualize it correctly))** created
before using File Stream, DataLake expects a new schema:

After which all pipelines are back to normal:

Method:
Get raw json stored in CouchDB => use file ID as the "link" between old
version of `FileMetadata` and new version of `FileMetadata` => then update
`FileMetadata` and File stored locally.
Test:
I haven't written any unit tests yet because I don't know how to test it
since `FileMetadata` class was changed. My original thought is this: create a
new class called `oldFileMetadata` which is the same as the `FileMetadata`
class that has both originalFilename and internalFilename => store that object
using a `CouchDbClient` => run the migration. However, I don't understand why
but `Utils.getCouchDbFileMetadataClient()`throws an exception of "unknown host"
in file I created
`streampipes-service-core/src/test/java/org.apache.streampipes.service.core.migrations.v095/MergeFilenamesAndRenameDuplicatesTest.java`
so I deleted it. I believe it's a package/config issue, do you have any idea
why?
<!--
Is there anything left we need to pay attention on?
Are there some references that might be important? E.g. links to Confluence,
or discussions
on the mailing list or GitHub.
-->
PR introduces (a) breaking change(s): yes? Please let me know if the
required manual schema update of Data Lake is a problem.
PR introduces (a) deprecation(s): no
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]