For files, there are INodeFile, INodeFileUnderConstruction, INodeFileWithSnapshot and INodeFileUnderConstructionWithSnapshot for representing whether a file is under construction or whether it is in some snapshot. The following are two major problems of the current approach:
- Java class does not support multiple inheritances so that INodeFileUnderConstructionWithSnapshot cannot extend both INodeFileUnderConstruction and INodeFileWithSnapshot.
- The number of classes is exponential to the number of features. Currently, there are only two features, UnderConstruction and WithSnapshot. The number of classes is 2^2 = 4. It is hard to add one more feature since the number of classes will become 2^3 = 8.
As a first step, we implement an Under-Construction feature to replace INodeFileUnderConstruction and INodeFileUnderConstructionWithSnapshot in this jira.