Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closes #4. Use MiniDFSCluster / SimulatedFSDataset to be more efficient #5

Merged
merged 1 commit into from
Mar 27, 2018

Conversation

xkrogen
Copy link
Collaborator

@xkrogen xkrogen commented Feb 9, 2018

DataNodes are launched via SimulatedDataNodes, which uses MiniDFSCluster to launch many DataNodes in the same JVM. Additionally, SimulatedFSDataset is used to avoid the requirement of writing sparse files to the disk - all block metadata is now stored in-memory.

@xkrogen xkrogen force-pushed the simulated-datanodes branch 3 times, most recently from 071b036 to 67fe568 Compare February 23, 2018 00:36
Copy link
Collaborator

@chliang71 chliang71 left a comment

Choose a reason for hiding this comment

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

LGTM, only some minor nit comments.


if (oStream.getLength() != finalSize) {
DataNode.LOG.warn("Size passed to finalize (" + finalSize +
")does not match what was written:" + oStream.getLength());
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: space after )

private long bytesAcked;
private long bytesRcvd;
private boolean pinned = false;
BInfo(String bpid, Block b, boolean forWriting) throws IOException {
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: add a newline before the method?

System.out.printf("Error injecting blocks into DataNode %d for block pool %s: %s%n", dnIndex, bpid,
ExceptionUtils.getFullStackTrace(ioe));
}
System.out.printf("Injected %d blocks into DataNode %d for block pool %s%n", cnt, dnIndex, bpid);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Looks like even if mc.injectBlocks throws exception, this line still gets printed out, after the error message. how about moving this line to right after mc.injectBlocks

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Definitely, good catch.


private final List<SimulatedStorage> storages;
private final String datanodeUuid;
private final DataNode datanode;
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: maybe cleaner move these to the beginning of class declaration


@Override // FSDatasetMBean
public String[] getFailedStorageLocations() {
return null;
Copy link
Collaborator

Choose a reason for hiding this comment

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

to avoid any potential NPE, maybe better to throw unsupported operation exception, or return an empty array?

…ch uses MiniDFSCluster to launch many DataNodes in the same JVM. Additionally, SimulatedFSDataset is used to avoid the requirement of writing sparse files to the disk - all block metadata is now stored in-memory.
@xkrogen
Copy link
Collaborator Author

xkrogen commented Mar 7, 2018

Thanks for the review @chen-liang ! Regarding the suggestions about changes to SimulatedMultiStorageFSDataset, this class is primarily just copied directly from Hadoop, I would rather make as few changes as possible to (a) avoid rewriting code that isn't ours, and (b) stay closer to the Hadoop version to increase the ease of porting in changes from upstream if necessary. Let me know what you think.

@chliang71
Copy link
Collaborator

Thanks for the update, @xkrogen ! +1

@xkrogen xkrogen merged commit 272dc66 into linkedin:master Mar 27, 2018
@xkrogen xkrogen deleted the simulated-datanodes branch March 27, 2018 17:21
@xkrogen
Copy link
Collaborator Author

xkrogen commented Mar 27, 2018

Thanks Chen!

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

Successfully merging this pull request may close these issues.

None yet

2 participants