private void syncViewInstance(ViewInstanceEntity instance1, ViewInstanceEntity instance2) {
    instance1.setLabel(instance2.getLabel());
    instance1.setDescription(instance2.getDescription());
    instance1.setViewUrl(instance2.getViewUrl());
    instance1.setVisible(instance2.isVisible());
    instance1.setResource(instance2.getResource());
    instance1.setViewInstanceId(instance2.getViewInstanceId());
    instance1.setClusterHandle(instance2.getClusterHandle());
    instance1.setClusterType(instance2.getClusterType());
    instance1.setData(instance2.getData());
    instance1.setEntities(instance2.getEntities());
    instance1.setProperties(instance2.getProperties());
  }
Sync given view with data in DB. Ensures that view data in DB is updated,
all instances changes from xml config are reflected to DB

@param view                view config from xml
@param instanceDefinitions view instances from xml
@throws Exception if the view can not be synced
ambari-server/src/main/java/org/apache/ambari/server/view/ViewRegistry.java