StephanEwen edited a comment on issue #9768: [FLINK-14086][test][core] Add 
OperatingArchitecture Enum
URL: https://github.com/apache/flink/pull/9768#issuecomment-584590929
 
 
   I think this mixes architecture and memory size is a confusing way. My 
original suggestion was more to change this to:
   
   ```java
   enum ProcessorArchitecture {
   
       x86(32),
       amd64(64),
       ppc64le(64),
       armv7(32),
       aarch64(64);
   
       // -----------------------------------
   
       private final int addressSize;
   
       private ProcessorArchitecture(int addressSize) {
           this.addressSize = addressSize;
       }
   
       public void addressSize() {
           return addressSize;
       }
   
       // -----------------------------------
   
       // logic to get current architecture
   
   }
   ```
   
   Then you can do things like:
   
   ```java
   switch (ProcessorArchitecture.getArchitecture().addressSize()) {
       case 64:
       case 32:
   }
   
   switch (ProcessorArchitecture.getArchitecture()) {
       case x86:
           platform = "386";
           break;
       case amd64:
           platform = "amd64";
           break;
       case armv7:
           platform = "armv7";
           break;
       case aarch64:
           platform = "arm64";
           break;
       default:
           platform = "Unknown";
           break;
   }
   ```
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to