Comments (10)
Hey @vgkholla i'm a total newbie
looking to get involved with the project! This looks like a great intro point do you mind if i throw up a pr?
from ambry.
@alecharmon Sure, go ahead !
If you want guidelines on what we expect on a PR, please take a look at the older ones. Usually we expect unit tests that cover all the lines (and if-else cases) of the new code and a confirmation of successful build (./gradlew build && ./gradlew test).
Let me know if you need any other assistance.
from ambry.
++
from ambry.
@alecharmon If you are working on this, would make sense to wait until #460 is merged and #391 is closed. Will make the job easier.
from ambry.
ahh ok tx @vgkholla
from ambry.
@alecharmon PR has been merged and the issue closed
from ambry.
If the issue is still open, I would like to work on this.
I also wanted to get more details -
-
What is the usecase for the new constructor? Is it to create the
buffer
thats part of the class from a list of buffers? Or is it to support a new list of buffers in the class? -
Could you please expand on this -
(The first constructor would call into the second constructor to avoid duplicate code).
Is the intention to just create a single buffer whose capacity equals the sum of the length of all buffers in the passed list?
from ambry.
@moontails the class surely should not create copies of any buffers it receives. The use case for the new constructor is that you might want to expose a List
of ByteBuffer
as a ReadableStreamChannel
. The current implementation forces the user to copy all that data into one big ByteBuffer
which can be avoided. Also the current implementation does not allow for dynamically adding more data to the channel.
The class internally would do something like:
- Write all available
ByteBuffer
out to the channel onreadInto
. - Wait for all write callbacks to arrive and then set read
future
and call readcallback
.
A very similar piece of code is available in MockRestRequest
(link). Look at how its readInto()
method is implemented and that should give you an idea. I would think that the code here should be quite similar here but you will have to add tests.
Also, like in MockRestRequest
, you should provide an addContent()
method that helps write data dynamically instead of having to provide it all in the beginning. This is what will be eventually helpful.
As for reusing code, the first constructor would do something like
public ByteBufferReadableStreamChannel(ByteBuffer buffer) {
this(Collections.singletonList(buffer));
}
Let me know if you have any more questions.
from ambry.
@vgkholla I misinterpreted the quoted statement.
Thank you for providing more explanation, it gives me a better picture. I will take a crack at this.
from ambry.
@vgkholla would it be alright to track addContent()
in a separate issue? I would like more details on its expected behavior for read operations.
from ambry.
Related Issues (20)
- service migrate HOT 1
- Cleanup ReplicationEngine:createThreadPool to avoid hardcoding Vcr
- Errors installing Ambry on a Windows based machine HOT 2
- Test failure: com.github.ambry.server.ServerSSLTest > undeleteCornerCasesTest
- Test failures in com.github.ambry.router.UndeleteManagerTest HOT 1
- Test failure: com.github.ambry.store.BlobStoreCompactorTest > deleteTombstoneCleanupTest
- UserQuotaRequestCostPolicy test coverage gaps
- Cannot post images from the quick start instruction
- Test failure: RouterServerSSLTest.interleavedOperationsTest
- Test failure: com.github.ambry.router.CloudRouterTest > testStitchGetUpdateDelete HOT 1
- Test failure: com.github.ambry.server.ServerSSLTest > undeleteCornerCasesTest HOT 1
- Test failure: com.github.ambry.frontend.FrontendIntegrationTest > accountApiTest[18]
- Test failure: com.github.ambry.server.ServerPlaintextTokenTest > endToEndReplicationWithMultiNodeSinglePartitionTest
- Error when run build
- Build failure because package azure-storage-blob:12.2.0 is not available on the Maven repository HOT 1
- Caused by: java.lang.NoSuchMethodException: com.github.ambry.cloud.HelixVcrClusterAgentsFactory.<init>() HOT 4
- Caffeine error while doing build HOT 1
- [QA] Ambry's future plan
- `PUT` should support `Content-MD5` header
- Ambry compaction and uploading very large files
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ambry.