Conversation
0e416d1 to
7e4ceca
Compare
src/main/java/io/tarantool/driver/core/TarantoolResultImpl.java
Outdated
Show resolved
Hide resolved
src/main/java/io/tarantool/driver/core/TarantoolResultImpl.java
Outdated
Show resolved
Hide resolved
src/main/java/io/tarantool/driver/core/TarantoolResultImpl.java
Outdated
Show resolved
Hide resolved
|
The main problem is that now we have two converters used to parse incoming tuples: The second level always needs to know the metadata, because it creates a TarantoolTuple and passes it there. Right now it only gets the metadata from the constructor. So I see 3 options:
|
|
I think the new converter variant (3) is the best because it doesn't allow to leak the implementation details through interfaces and leaves in place the ability to have different result mappers (e.g. for libs other than Tarantool/crud or non-tuple results). The converter instantiation is a parallel problem and should be dealt with as a whole, not in this particular place. |
akudiyar
left a comment
There was a problem hiding this comment.
It's a better idea overall then changing the ValueConverter interface, however the changes look very rough. I'd rather not copy-paste the whole converters code in that way. Also It may be worth thinking about passing a tuple converter factory to the result converter instead of a tuple converter, that will help eliminating the fromValue method and unnecessary casts.
src/main/java/io/tarantool/driver/mappers/MultiValueTarantoolResultMapperFactory.java
Outdated
Show resolved
Hide resolved
src/main/java/io/tarantool/driver/mappers/TarantoolTupleMultiResultMapperFactory.java
Outdated
Show resolved
Hide resolved
src/main/java/io/tarantool/driver/core/TarantoolResultImpl.java
Outdated
Show resolved
Hide resolved
src/main/java/io/tarantool/driver/core/TarantoolResultImpl.java
Outdated
Show resolved
Hide resolved
src/main/java/io/tarantool/driver/core/TarantoolTupleResultImpl.java
Outdated
Show resolved
Hide resolved
src/main/java/io/tarantool/driver/core/TarantoolTupleResultImpl.java
Outdated
Show resolved
Hide resolved
src/main/java/io/tarantool/driver/core/TarantoolTupleResultImpl.java
Outdated
Show resolved
Hide resolved
.../java/io/tarantool/driver/mappers/converters/value/custom/TarantoolTupleResultConverter.java
Outdated
Show resolved
Hide resolved
6cd2683 to
d39b171
Compare
188c651 to
895c123
Compare
| /** | ||
| * @author Artyom Dubinin | ||
| */ | ||
| public class CRUDResponseMetadataParser implements SpaceMetadataParser { |
There was a problem hiding this comment.
What's the purpose of this class? Currently it looks like doing nothing.
There was a problem hiding this comment.
I changed classes. You should check
| /** | ||
| * @author Artyom Dubinin | ||
| */ | ||
| public class DDLSpaceMetadataParser implements SpaceMetadataParser { |
There was a problem hiding this comment.
This class needs some unit tests and a Javadoc.
There was a problem hiding this comment.
They're already tested in integrations tests. I don't think it's nessasary to think about syntaticly creation of ddl, _vspace, crud methods answers
| /** | ||
| * @author Artyom Dubinin | ||
| */ | ||
| public interface SpaceMetadataParser { |
There was a problem hiding this comment.
This class needs some unit tests and a javadoc.
| public class DDLSpaceMetadataParser implements SpaceMetadataParser { | ||
|
|
||
| @Override | ||
| public TarantoolSpaceMetadataImpl parse(Value metadata) { |
There was a problem hiding this comment.
Shouldn't it take MapValue explicitly?
There was a problem hiding this comment.
If we want to have one interface for metadata parsing we need to use Value. Metadata can be stored in different structures
| /** | ||
| * @author Artyom Dubinin | ||
| */ | ||
| public class VSpaceMetadataParser implements SpaceMetadataParser { |
There was a problem hiding this comment.
This class needs unit tests and a Javadoc.
| * @author Artyom Dubinin | ||
| */ | ||
| class TarantoolFieldMetadataImpl implements TarantoolFieldMetadata { | ||
| public class TarantoolFieldMetadataImpl implements TarantoolFieldMetadata { |
There was a problem hiding this comment.
Do we really need to make it public? It's an internal implementation class.
There was a problem hiding this comment.
There are two options here:
- package private - We store converters(parsers in future) in
*.core.metadatapackage - public - we open this class and store classes where they should be semantically
There was a problem hiding this comment.
First option has been picked up
Now we can obtain metadata from the response and don't use metadata from ddl.
I didn't forget about:
Closes #272