GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — expose method to create parser from direct memory by arnaudroger · Pull Request #435 · msgpack/msgpack-java

Conversation

@arnaudroger

@arnaudroger arnaudroger commented Oct 10, 2017

Copy link
Copy Markdown

Useful to parse message coming in from netty for example without creating a lot of garbage.
Also expose the method to create a parser from a sub array.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
arnaudroger
expose method to create parser from direct memory
eb0d637
@xerial
xerial requested a review from komamitsu October 21, 2017 01:44
@xerial

xerial commented Oct 21, 2017

Copy link
Copy Markdown
Member

@komamitsu Could you review this change? This seems a good improvement.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

komamitsu
komamitsu requested changes Oct 21, 2017
View reviewed changes

@komamitsu komamitsu left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@arnaudroger Thanks for the contribution! It seems a cool feature.

But I have some questions. Can I ask you to take a look at them?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread msgpack-core/src/main/java/org/msgpack/core/buffer/ByteBufferInput.java
* @param address the address
* @param offset the offset
* @param length the length
* @return a new ByteBufferInput on the specified address

@komamitsu komamitsu Oct 21, 2017

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This static method returns ByteBuffer not ByteBufferInput

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread msgpack-core/src/main/java/org/msgpack/core/buffer/ByteBufferInput.java
*/
public static ByteBuffer directBuffer(long address, int offset, int length)
{
return DirectBufferAccess.newByteBuffer(address, offset, length, null);

@komamitsu komamitsu Oct 21, 2017

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't seem to me that this method is related to ByteBufferInput.

@xerial Do you think this is the right place to put the method in?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@xerial xerial Nov 29, 2017

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can make DirectBufferAccess a public class instead of adding this method.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@xerial xerial Nov 29, 2017

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually this location is a bit weird.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread msgpack-jackson/src/main/java/org/msgpack/jackson/dataformat/MessagePackFactory.java
IOContext ioContext = _createContext(data, false);
return _createParser(data, offset, length, ioContext);
}

@komamitsu komamitsu Oct 21, 2017

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As you might notice since this method doesn't have @Override annotation, Jackson doesn't support this kind of API, I think.

How do you use this method via Jackson's API? It would be great, if you add some unit tests to make it clear 😺

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@arnaudroger arnaudroger Oct 21, 2017

Copy link
Copy Markdown
Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I use the MessagePackFactory directly, currently using reflection.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@xerial xerial xerial left review comments
@komamitsu komamitsu komamitsu requested changes

Requested changes must be addressed to merge this pull request.

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@arnaudroger @xerial @komamitsu
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.