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
Georges suggestions #8
base: georgeMaster
Are you sure you want to change the base?
Conversation
@@ -84,7 +86,7 @@ public OmTestManagers(OzoneConfiguration conf, | |||
blockClient = | |||
new ScmBlockLocationTestingClient(null, null, 0); | |||
} | |||
|
|||
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.
remove this
@@ -116,7 +118,15 @@ public OmTestManagers(OzoneConfiguration conf, | |||
.getInternalState(om, "bucketManager"); | |||
prefixManager = (PrefixManagerImpl)HddsWhiteboxTestUtils | |||
.getInternalState(om, "prefixManager"); | |||
} | |||
|
|||
public KeyProviderCryptoExtension kmsProviderInit() { |
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.
add a comment something like:
// returns a mock kmsProvider
import org.junit.Assert; | ||
import org.junit.Test; | ||
import org.junit.Rule; | ||
|
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.
why did you add these here and remove them below?
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.
Changed that as well to minimize the diffs
|
||
import org.apache.hadoop.crypto.key.KeyProvider; | ||
import org.apache.hadoop.crypto.key.KeyProviderCryptoExtension; | ||
import org.apache.hadoop.hdds.client.StandaloneReplicationConfig; | ||
import org.apache.hadoop.hdds.conf.OzoneConfiguration; | ||
import org.apache.hadoop.hdds.protocol.StorageType; | ||
import org.apache.hadoop.hdds.protocol.proto.HddsProtos.ReplicationFactor; | ||
import org.apache.hadoop.hdds.protocol.proto.HddsProtos; |
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.
why did this change?
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 seems that the IDE altered it because I was making a static reference to ReplicationFactor like HddsProtos.ReplicationFactor, but I changed it to minimize the changes.
@@ -67,51 +85,51 @@ private OzoneConfiguration createNewTestPath() throws IOException { | |||
return conf; | |||
} | |||
|
|||
private OmMetadataManagerImpl createSampleVol() throws IOException { | |||
private void createSampleVol() throws IOException, AuthenticationException { |
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.
Does this really need the AuthenticationException?
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 need that due to initialization of OmTestManagers. If I remove that there is an error from the IDE.
try { | ||
BucketManager bucketManager = new BucketManagerImpl(metaMgr); | ||
OzoneManagerProtocol writeCl = omTestManagers.getWriteClient(); |
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've used writeClient everywhere else. I would use that instead of writeCl here.
It's good to be consistent unless there is a good reason otherwise.
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 declared OzoneManagerProtocol as well based on your PR and then I was getting an error from checkstyle about hiding the class field with the same name. But now I realize there is a so much better way and simpler way because the class field has not been initialized. I will fix that.
.setBucketEncryptionKey(new | ||
BucketEncryptionKeyInfo.Builder().setKeyName("key1").build()) | ||
BucketEncryptionKeyInfo.Builder().setKeyName("key1").build()) |
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.
extra space?
|
||
OmBucketInfo bucketInfoRead = | ||
bucketManager.getBucketInfo("sampleVol", "bucketOne"); | ||
bucketManager.getBucketInfo("sample-vol", "bucket-one"); |
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.
extra space
|
||
Assert.assertTrue(bucketInfoRead.getEncryptionKeyInfo().getKeyName() | ||
.equals(bucketInfo.getEncryptionKeyInfo().getKeyName())); | ||
metaMgr.getStore().close(); | ||
.equals(bucketInfo.getEncryptionKeyInfo().getKeyName())); |
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.
extra space
} | ||
|
||
private OzoneConfiguration createNewTestPath() throws IOException, | ||
AuthenticationException { |
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.
Does this really need the AuthenticationException?
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.
That's actually not needed, I will remove it. I declared inside the method omTestManagers but when I removed the field, I forgot about it.
No description provided.