> On May 16, 2016, 4:48 p.m., Ajit Kumar wrote: > > ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog240.java, > > line 320 > > <https://reviews.apache.org/r/46962/diff/1/?file=1370531#file1370531line320> > > > > Is maxId == 0 valid?
yes it is valid. the id of first entity will be 1. verified. - Nitiraj ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/46962/#review133376 ----------------------------------------------------------- On May 16, 2016, 1:59 p.m., Nitiraj Rathore wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/46962/ > ----------------------------------------------------------- > > (Updated May 16, 2016, 1:59 p.m.) > > > Review request for Ambari, Alejandro Fernandez, DIPAYAN BHOWMICK, Gaurav > Nagar, Rohit Choudhary, and Ashwin Rajeev. > > > Bugs: AMBARI-16242 > https://issues.apache.org/jira/browse/AMBARI-16242 > > > Repository: ambari > > > Description > ------- > > Earlier : > the id for dynamic entity was created in the application with the use of > instance data for that view. This data is dependent on users and created > separate sequences for each user. So the id for one user was also generated > for other user. Hence the data in db of one user was getting overriden by > other user. > > In this patch : > Now the id is generated using table_sequence techique of JPA. table for > sequence is ambari_sequence. UpgradeCatalog240.java will add the current > sequence number for existing tables and for new table the sequence name will > be added automatically. As sequence size of 50 is provided for better > performances > > > Diffs > ----- > > > ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog240.java > dc8d9b7 > > ambari-server/src/main/java/org/apache/ambari/server/view/persistence/DataStoreImpl.java > 0ed260d > > contrib/views/hive/src/main/java/org/apache/ambari/view/hive/persistence/DataStoreStorage.java > 1e8f07f > > contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/jobs/JobService.java > f7f883b > > contrib/views/pig/src/main/java/org/apache/ambari/view/pig/persistence/DataStoreStorage.java > 7ae7721 > > Diff: https://reviews.apache.org/r/46962/diff/ > > > Testing > ------- > > Following manual testing has been done. > 1. upgrade script creates correct current sequences. Done by manually > upgrading old ambari with existing views. Next job will allocate 50 more ids > 2. for new tables the entry in ambari_sequence is automatically added and the > ids will start from 1. > > > Thanks, > > Nitiraj Rathore > >