-
Notifications
You must be signed in to change notification settings - Fork 1k
PHOENIX-7623: Add a profile which runs ITs with phoenix ha client #2205
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
base: PHOENIX-7623-feature
Are you sure you want to change the base?
Conversation
|
There are some merge conflicts |
| if (!clusterInitialized) { | ||
| throw new IllegalStateException("Cluster must be initialized before attempting to get the URL"); | ||
| } | ||
| if(Boolean.parseBoolean(System.getProperty("phoenix.ha.profile.active"))){ |
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.
Change to constant in HAGroup
| url = haGroup.getRoleRecord().getActiveUrl(); | ||
| if (url.isPresent()) { | ||
| return url.get() + ";" + PHOENIX_TEST_DRIVER_URL_PARAM; | ||
| } else { |
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 else block
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.
Took initial look, some comments and questions
one suggestion, if we have failing tests which can't be run in HA Mode, maybe exclude them in pom for HA test profile so that for default they run as it is
| public ConnectionQueryServices getQueryServices() throws SQLException { | ||
| throw new UnsupportedOperationException(); | ||
| } | ||
|
|
||
| @Override | ||
| public PTable getTable(PTableKey key) throws SQLException { | ||
| throw new UnsupportedOperationException(); | ||
| } | ||
|
|
||
| @Override | ||
| public PTable getTable(String name) throws SQLException { | ||
| throw new UnsupportedOperationException(); | ||
| } | ||
|
|
||
| @Override | ||
| public PTable getTableNoCache(String name) throws SQLException { | ||
| throw new UnsupportedOperationException(); | ||
| } | ||
|
|
||
| @Override | ||
| public Consistency getConsistency() throws SQLException { | ||
| throw new UnsupportedOperationException(); | ||
| } | ||
|
|
||
| @Override | ||
| @Nullable | ||
| public PName getTenantId() throws SQLException { | ||
| throw new UnsupportedOperationException(); | ||
| } | ||
|
|
||
| @Override | ||
| public MutationState getMutationState() throws SQLException { | ||
| throw new UnsupportedOperationException(); | ||
| } | ||
|
|
||
| @Override | ||
| public PMetaData getMetaDataCache() throws SQLException { | ||
| throw new UnsupportedOperationException(); | ||
| } | ||
|
|
||
| @Override | ||
| public int getMutateBatchSize() throws SQLException { | ||
| throw new UnsupportedOperationException(); | ||
| } | ||
|
|
||
| @Override | ||
| public int executeStatements(Reader reader, List<Object> binds, PrintStream out) throws IOException, SQLException { | ||
| throw new UnsupportedOperationException(); | ||
| } | ||
|
|
||
| @Override | ||
| public Format getFormatter(PDataType type) throws SQLException { | ||
| throw new UnsupportedOperationException(); | ||
| } | ||
|
|
||
| @Override | ||
| public void setRunningUpgrade(boolean isRunningUpgrade) throws SQLException { | ||
| throw new UnsupportedOperationException(); | ||
| } | ||
|
|
||
| @Override | ||
| public PTable getTable(String tenantId, String fullTableName) throws SQLException { | ||
| throw new UnsupportedOperationException(); | ||
| } | ||
|
|
||
| @Override | ||
| public PTable getTableNoCache(PName tenantId, String name) throws SQLException { | ||
| throw new UnsupportedOperationException(); | ||
| } | ||
|
|
||
| @Override | ||
| public void setIsClosing(boolean imitateIsClosing) throws SQLException { | ||
| throw new UnsupportedOperationException(); | ||
| } | ||
|
|
||
| @Override | ||
| public String getDatePattern() throws SQLException { | ||
| throw new UnsupportedOperationException(); | ||
| } | ||
|
|
||
| @Override | ||
| public PTable getTable(@Nullable String tenantId, String fullTableName, @Nullable Long timestamp) throws SQLException { | ||
| throw new UnsupportedOperationException(); | ||
| } | ||
|
|
||
| @Override | ||
| public boolean isRunningUpgrade() throws SQLException { | ||
| throw new UnsupportedOperationException(); | ||
| } | ||
|
|
||
| @Override | ||
| public String getURL() throws SQLException { | ||
| throw new UnsupportedOperationException(); | ||
| } | ||
|
|
||
| @Override | ||
| public LogLevel getLogLevel() throws SQLException { | ||
| throw new UnsupportedOperationException(); |
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.
Can we use runOnConnections() for these methods, we are not using parallel policy for tests but if we want to then it will be helpful?
| import org.junit.Test; | ||
| import org.junit.experimental.categories.Category; | ||
|
|
||
| //Passing with HA Connection |
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.
If all the tests in PR here are passing then we can start removing these comments
| props.put(QueryServices.PHOENIX_POST_VALID_PROCESS, | ||
| TestScanningResultPostValidResultCaller.class.getName()); | ||
| setUpTestDriver(new ReadOnlyProps(props.entrySet().iterator())); | ||
| if(Boolean.parseBoolean(System.getProperty("phoenix.ha.profile.active"))){ |
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.
Can we make phoenix.ha.profile.active a constant.
| import org.apache.phoenix.thirdparty.com.google.common.base.Function; | ||
| import org.apache.phoenix.thirdparty.com.google.common.collect.Lists; | ||
|
|
||
| //Failing with HA Connection |
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.
Is this test still failing?
|
|
||
| } else if(e instanceof TableNotFoundException) { | ||
|
|
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.
If these exceptions are expected, then please add a comment that this is expected.
| import org.apache.phoenix.util.SchemaUtil; | ||
| import org.apache.phoenix.util.StringUtil; | ||
| import org.apache.phoenix.util.TestUtil; | ||
| import org.apache.phoenix.util.*; |
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.
Please don't use * imports
| conf = HBaseConfiguration.create(); | ||
| hbaseTestUtil = new HBaseTestingUtility(conf); | ||
| setUpConfigForMiniCluster(conf); | ||
| conf.set(QueryServices.EXTRA_JDBC_ARGUMENTS_ATTRIB, QueryServicesOptions.DEFAULT_EXTRA_JDBC_ARGUMENTS); |
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 are we not passing this prop in conf for HA mode?
| * Disabling this test as this works on TTL being set on View which is removed and will be added in future. | ||
| * TODO:- To enable this test after re-enabling TTL for view for more info check :- PHOENIX-6978 | ||
| */ | ||
| //Failing with HA Connection |
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 test is not being run, no change needed here
| public void testPreMatureScannerAbortForCount() throws Exception { | ||
|
|
||
| try (Connection conn = DriverManager.getConnection(getUniqueUrl())) { | ||
| System.out.println("get url pls check all" + url); |
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.
clean up required here.
| } | ||
|
|
||
| @Test | ||
| // @Test - ignoring local index test for HA Connection |
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.
same here don't ignore for default mode
|
Does the feature branch have spotless format? i.e. is it upto date with master branch? |
No description provided.